Introduce and use config/gcc-version.m4.
[gcc.git] / libmudflap / ChangeLog
1 2004-12-02 Richard Sandiford <rsandifo@redhat.com>
2
3 * configure.ac: Use TL_AC_GCC_VERSION to set gcc_version.
4 * aclocal.m4: Include ../config/gcc-version.m4.
5 * configure, Makefile.in, testsuite/Makefile.in: Regenerate.
6
7 2004-11-29 Kelley Cook <kcook@gcc.gnu.org>
8
9 * Makefile.am: Define ACLOCAL_AMFLAGS.
10 * acinclude.m4: Remove.
11 * stamp-h.in: Remove superfluous stamp file.
12 * aclocal.m4, configure, Makefile.in: Regenerate.
13 * testsuite/Makefile.in: Likewise.
14
15 2004-11-24 Kelley Cook <kcook@gcc.gnu.org>
16
17 * Makefile.am: Revert previous.
18 * acinclude.m4: Restore.
19 * aclocal.m4, configure, Makefile.in: Regenerate.
20 * testsuite/Makefile.in: Likewise.
21
22 2004-11-24 Kelley Cook <kcook@gcc.gnu.org>
23
24 * Makefile.am: Define ACLOCAL_AMFLAGS.
25 * acinclude.m4: Remove.
26 * aclocal.m4, configure, Makefile.in: Regenerate.
27 * testsuite/Makefile.in: Likewise.
28
29 2004-11-23 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
30
31 * testsuite/lib/libmudflap.exp: Use new procs in target-libpath.exp.
32
33 2004-11-23 Kelley Cook <kcook@gcc.gnu.org>
34
35 * Makefile.in, configure, aclocal.m4: Regenerate with automake 1.9.3.
36 * testsuite/Makefile.in: Likewise.
37
38 2004-11-01 Andreas Schwab <schwab@suse.de>
39
40 * configure.ac: (target_alias): Default to $host_alias, not
41 $target.
42 * configure: Regenerated.
43
44 2004-10-28 Frank Ch. Eigler <fche@redhat.com>
45
46 * testsuite/libmudflap.c/fail35-,pass53-,pass54-frag.c: New tests.
47 * testsuite/libmudflap.c/pass35-frag.c: Correct embedded warning
48 message.
49
50 2004-10-25 Eric Botcazou <ebotcazou@libertysurf.fr>
51
52 PR other/18138
53 * testsuite/lib/libmudflap.exp: Accept more than one multilib libgcc.
54
55 2004-10-12 Frank Ch. Eigler <fche@redhat.com>
56
57 * configure.ac: Check for more headers, functions.
58 * mf-hooks2.c (mkbuffer, unmkbuffer): New helper functions for
59 tracking overridden FILE buffers.
60 (fopen, setvbuf): New/revised hook functions for buffer overriding.
61 (setbuf,setlinebuf,fdopen,freopen,fopen64,freopen64,fclose): Ditto.
62 (fflush): Accept given NULL stream (means "all streams").
63 * mf-runtime.h.in:
64 * mf-runtime.c (__mfu_check): Accept accesses that span adjacent
65 HEAP/GUESS objects.
66 (LOOKUP_CACHE_SIZE_MAX): Raise to 64K entries tentatively.
67 (__mf_adapt_cache): Use them all.
68 * testsuite/libmudflap.c/pass35-frag.c: Update warning message.
69 * testsuite/libmudflap.c++/ctors.exp: Ditto.
70 * testsuite/libmudflap.c/{pass51,pass52}-frag.c: New tests.
71 * configure, config.h.in: Regenerated.
72
73 2004-10-05 Frank Ch. Eigler <fche@redhat.com>
74
75 * configure.ac: Checking for sys/socket.h once is enough.
76 * configure: Regenerated.
77
78 2004-10-04 Frank Ch. Eigler <fche@redhat.com>
79
80 * configure.ac: Look for more headers & functions.
81 * mf-hooks2.c (getmntent, inet_ntoa, getproto*): New wrapper functions.
82 * mf-runtime.h.in: Add new "#pragma redefine_extname"s for them.
83 * mf-runtime.c (options): Clean up integer signedness warnings.
84 (main): Add a declaration to fix a warning.
85 * mf-hooks3.c (pthread_exit): Add not-reached exit() to wrapper.
86 * configure, config.h.in: Regenerated.
87
88 2004-10-02 Frank Ch. Eigler <fche@redhat.com>
89
90 * testsuite/libmudflap.c/pass50-frag.c, fail33-frag.c, fail34-frag.c:
91 New tests for proper base/limit checking for aggregates.
92
93 2004-09-15 Joseph S. Myers <jsm@polyomino.org.uk>
94
95 * testsuite/libmudflap.c/pass35-frag.c: Update expected message.
96
97 2004-09-07 Frank Ch. Eigler <fche@redhat.com>
98
99 * configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.
100 * mf-hooks2.c (strerror): Unregister previous string returned by
101 previous strerror.
102 (getlogin,cuserid,getpwnam,getpwuid,getgrnam,getgrgid): New wrappers.
103 (getservent,getservbyname,getservbyport,gai_strerror): Ditto.
104 * mf-runtime.h.in: Add redefine_extname pragmas for them all.
105 * mf-runtime.c (__mf_describe_object): Clarify object life status.
106 * testsuite/libmudflap.c/pass48-frag.c, pass49-frag.c, fail32-frag.c:
107 New tests.
108 * configure, config.h.in: Regenerated.
109
110 2004-08-03 Dale Johannesen <dalej@apple.com>
111
112 * mf-runtime.c: Conditionalize POSIX_SOURCE for Darwin.
113
114 2004-08-03 Frank Ch. Eigler <fche@redhat.com>
115
116 * mf-runtime.c (compare_uintptr_t): Remove function. Inline
117 simplified contents in all former callers.
118
119 2004-07-27 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
120
121 * mf-runtime.c (__mf_fini): Set mudflap_mode to mode_nop in
122 the statically linked case.
123
124 2004-07-27 Frank Ch. Eigler <fche@redhat.com>
125
126 * splay-tree.[ch]: Remove. Merge contents into ...
127 * mf-runtime.c: ... here, renaming symbols and making all functions
128 static. Remove unused min/max functions.
129 * Makefile.am: Forget about splay-tree.[ch].
130 * Makefile.in, testsuite/Makefile.in: Regenerated.
131
132 2004-07-21 Frank Ch. Eigler <fche@redhat.com>
133
134 * mf-runtime.c (__mfu_check): Remove mistaken mode-nop handling.
135 (__mfu_usage): Include (C) 2004.
136 * mf-hooks3.c (__mf_find_threadinfo): Don't call tracing functions
137 here. Include a comment explaining why.
138
139 2004-07-20 Frank Ch. Eigler <fche@redhat.com>
140
141 * mf-impl.h (__mf_options): Add ignore_reads and timestamps fields.
142 * mf-runtime.c (options): Give them a name.
143 (__mf_set_default_options): Set them.
144 (__mf_insert_new_object, __mfu_unregister): Optionalize timestamps.
145 (__mf_violation): Warning cleanup.
146 * mf-impl.h (MF_VALIDATE_EXTENT): Support ignore_reads option.
147 * splay-tree.c (splay_tree_delete_helper): Remove obsolete decl.
148
149 2004-07-15 Frank Ch. Eigler <fche@redhat.com>
150
151 g++/15861
152 * mf-runtime.c (__mf_init): Make it non-static. Tolerate
153 repeated invocation.
154
155 2004-07-09 Frank Ch. Eigler <fche@redhat.com>
156
157 Test case for g++/15861
158 * testsuite/libmudflap.c++/ctors-[12].cxx: New test case halves.
159 * testsuite/libmudflap.c++/ctors.exp: Driver.
160 * testsuite/libmudflap.c++/c++frags.exp: Elide redundant default.
161 Look only for *frag* test cases.
162
163 2004-07-08 Frank Ch. Eigler <fche@redhat.com>
164
165 ANSI C conversion, libmudflap specialization, recursion limiting.
166 * splay-tree.h (splay_tree_{de,}allocate_fn): Remove allocation_data
167 argument and indirection function pointers, update callers.
168 (splay_tree_s): Add statistics and recursion control fields
169 num_keys, max_depth, depth, rebalance_p.
170 * splay-tree.c (splay_tree_splay_helper): Track recursion depth.
171 Back out of search if it exceeds limit.
172 (splay_tree_splay): Manage recursion limiting with rebalancing as
173 needed.
174 (splay_tree_new): More initialization.
175 (splay_tree_rebalance): New function.
176 (splay_tree_foreach): Rewrite using nonrecursive logic.
177 (splay_tree_xmalloc_allocate, splay_tree_xmalloc_deallocate):
178 Remove. Point indirect calls to mf-runtime.c's routines.
179 (splay_tree_compare_ints, splay_tree_compare_pointers): Remove unused
180 functions.
181 (splay_tree_delete, splay_tree_delete_helper): Ditto.
182 * testsuite/heap-scalestress.c: New test based on one from
183 Eyal Lebedinsky <eyal@eyal.emu.id.au>:
184
185 2004-07-05 Matthias Klose <doko@debian.org>
186
187 * libtool-version: New.
188 * Makefile.am (libmudflap_la_LDFLAGS, libmudflapth_la_LDFLAGS):
189 Use -version-info for soname.
190 * Makefile.in: Regenerate.
191 * configure.ac: Remove libtool_VERSION macro
192 * configure: Regenerate
193
194 2004-07-05 Zack Weinberg <zack@codesourcery.com>
195
196 * mf-runtime.h.in: Wrap declarations of struct __mf_cache,
197 __mf_lookup_cache, __mf_lc_mask, or __mf_lc_shift in
198 #ifndef _MUDFLAP.
199
200 2004-06-29 Frank Ch. Eigler <fche@redhat.com>
201
202 Splay tree implementation fork.
203 * splay-tree.c, splay-tree.h: Copied & modified from libiberty.
204 Use hard-coded comparison function for uintptr_t. Remove key/value
205 deallocation logic. Cache last splayed key for consecutive lookups.
206 * Makefile.am, Makefile.in: Use them, don't link to them.
207 * mf-runtime.c (__mf_object_tree): Adapt to simpler splay_tree_new.
208 (__mf_find_objects2): Flip successor/predecessor search sequence.
209 * ansidecl.h, libiberty.h: Removed dummy files.
210
211 2004-06-29 Nick Clifton <nickc@redhat.com>
212
213 * configure.ac (AC_CHECK_HEADERS): Add dirent.h
214 * configure: Regenerate.
215 * mf-hooks2.c: Surround uses of dirent.h with #ifdef
216 HAVE_DIRENT_H.
217 Remove spurious inclusion of <strings.h>.
218
219 2004-06-29 Nick Clifton <nickc@redhat.com>
220
221 * mf-runtime.c (pthread_join): Only apply the weak pragma if the
222 function actually exists.
223
224 2004-06-25 Frank Ch. Eigler <fche@redhat.com>
225
226 * ansidecl.h, libiberty.h: New dummy files for building splay-tree.
227 * config.h.in: Regenerated.
228
229 2004-06-24 Frank Ch. Eigler <fche@redhat.com>
230
231 Adopt splay trees for object database.
232 * Makefile.am: Copy splay-tree.* from libiberty.
233 * Makefile.in, testsuite/Makefile.in: Regenerated.
234 * mf-runtime.h.in (__mf_unregister): Add third parameter (type).
235 * mf-hooks[123].c (*): Add new third parameter to mf_unregister.
236 * mf-impl.h (BEGIN_PROTECT): Remove some trace text.
237 * mf-runtime.c: Rewrite code dealing with object database to use
238 libiberty splay trees. Remove tree liveness aging option.
239 * testsuite/libmudflap.c/fail18-frag.c: Add volatile flag.
240
241 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
242
243 * configure.ac: New name of configure.in. Update
244 AC_INIT, AC_CONFIG_SRCDIR, AC_CONFIG_HEADERS, AC_CONFIG_FILES,
245 AC_OUTPUT, AM_INIT_AUTOMAKE to the preferred style for
246 Autoconf 2.5x and Automake 1.7 or later.
247 * configure.in: Remove.
248 * configure: Regenerate.
249
250 * Makefile.am: Remove useless multilib rules.
251 * Makefile.in: Regenerate.
252
253 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
254
255 * .cvsignore: New file.
256
257 2004-06-10 Stephen Crowley <stephen.crowley@sbcglobal.net>
258
259 PR libmudflap/13505
260 * mf-hooks2.c (semctl): Add cygwin porting hack.
261
262 2004-06-09 Frank Ch. Eigler <fche@redhat.com>
263
264 ctype support.
265 * configure.in: Look for ctype header and glibc implementation.
266 * mf-hooks2.c (__ctype_{b,toupper,tolower}_loc): Sample ctype
267 array hooks for glibc 2.3.
268 * mf-runtime.h.in: Wrap them.
269 * mf-runtime.c (__mf_init): Leave marker regarding other ctype
270 implementations.
271 * testsuite/libmudflap.c/pass47-frag.c: New test.
272 * configure, config.h.in: Regenerated.
273
274 2004-06-04 Frank Ch. Eigler <fche@redhat.com>
275
276 Portability improvements, e.g., libmudflap/15293.
277 * configure.in: Look for glibc extension functions. Look for
278 support of -f{function,data}-sections. Look for more headers.
279 Create testsuite/mfconfig.exp. Correct more "test x.." thinkos.
280 * Makefile.am: Use $(SECTION_FLAGS). Collapse piecemeal-compiled
281 mf-hooks* into usual single object per source.
282 * mf-hooks*.c: Remove all #if WRAP_foo conditionals.
283 * mf-hooks2.c: #include a bunch more system headers. Define strnlen
284 if system doesn't provide one.
285 * mf-hooks3.c (struct pthread_info): Add stack_*_alloc fields.
286 (pthread_create): Use it to properly GC dead thread stacks.
287 * mf-runtime.c (__mf_violation): Correct snprintf type warning.
288 * testsuite/Makefile.am: Stop generating site.exp.
289 * testsuite/mfconfig.exp.in: New file.
290 * testsuite/config/default.exp: Load new mfconfig.exp.
291 * testsuite/lib/libmudflap.exp (libmudflap-init): Add extra libraries.
292 (prune_gcc_output): Add glibc static linking warnings.
293 * testsuite/libmudflap.*/*frags.exp: Enumerate needed -lmudflap* libs.
294 * testsuite/libmudflap.c/pass46-frag.c: Ditto.
295 * configure, Makefile, aclocal.m4, config.h.in, testsuite/Makefile.in:
296 Regenerated with autoconf 2.57 and automake 1.7.
297
298 2004-06-04 Per Bothner <per@bothner.com>
299
300 * configure.in (LIBMUDFLAPTH): Fix thinko.
301
302 * configure.in: Check for more headers.
303 * mf-hooks2.c: Conditionalize on HAVE_SYS_SOCKET_H etc.
304
305 * mf-runtime.c: In two places conditionalize on SIUSR1 rather than
306 HAVE_SIGNAL as mingw has signal.h but not SIUSR1.
307
308 2004-06-01 Andreas Jaeger <aj@suse.de>
309
310 * configure.in: Handle multilibs, support
311 --enable-version-specific-runtime-libs.
312 * Makefile.am (lib_LTLIBRARIES): Rename to ...
313 (toolexeclib_LTLIBRARIES): this for multilib support.
314 * Makefile.in: Regenerated.
315 * configure: Regenerated.
316 * aclocal.m4: Regenerated.
317 * config.h.in: Regenerated.
318 * testsuite/Makefile.in: Regenerated.
319
320 2004-06-01 Andreas Jaeger <aj@suse.de>
321
322 * testsuite/lib/libmudflap.exp (libmudflap-init): Handle
323 multilibs, using multilib directory instead of hardcoded path.
324 Set LD_RUN_PATH.
325
326 2004-05-21 Frank Ch. Eigler <fche@redhat.com>
327
328 * Makefile.am (AM_MAKEFLAGS): Pass RUNTESTFLAGS.
329 * Makefile.in: Ditto.
330
331 2004-05-18 Kaz Kojima <kkojima@gcc.gnu.org>
332
333 * acinclude.m4 (lt_cv_deplibs_check_method): Use pass_all on sh*.
334 * aclocal.m4, configure: Rebuilt.
335
336 2004-05-17 Frank Ch. Eigler <fche@redhat.com>
337
338 * lib/libmudflap.exp (libmudflap-init): For C++ test cases only,
339 import some build settings from libstdc++-v3 testsuite_flags.
340 * .../cfrags.exp, .../c++frags.exp, .../cthfrags.exp: Corresponding
341 changes to pass test language.
342
343 * mf-runtime.c (__mfu_check): Poison the cache with antidote for
344 quicker mode-nop handling.
345
346 2004-03-25 Frank Ch. Eigler <fche@redhat.com>
347
348 * mf-impl.h: Added libgcc license header.
349
350 2004-03-20 Frank Ch. Eigler <fche@redhat.com>
351
352 * mf-hooks[123].c, mf-runtime.c, mf-heuristics.c:
353 Added libgcc license header.
354 * mf-hooks3.c (__mf_0fn_pthread_create): Correct arg constness.
355 (pthread_create): Simplify stack allocation syntax.
356
357 2004-03-08 Loren J. Rittle <ljrittle@acm.org>
358
359 * mf-hooks2.c: Support FreeBSD.
360 (WRAP_gets): Avoid gets().
361 * testsuite/libmudflap.c/pass-stratcliff.c: Do not
362 test unimplemented mem/str calls on FreeBSD.
363 * testsuite/libmudflap.c/pass21-frag.c: Do not include
364 <alloca.h> on FreeBSD.
365
366 2004-01-30 Frank Ch. Eigler <fche@redhat.com>
367
368 * testsuite/libmudflap.c/pass36-frag.c: Add missing free() call.
369 * testsuite/libmudflap.c/pass46-frag.c: New test for -fmudflapir.
370 * testsuite/libmudflap.cth/cthfrags.exp: Add -DSTATIC to compiler
371 flags for static linking permutation.
372 * testsuite/libmudflap.cth/pass40-frag.c: When -DSTATIC, avoid
373 some pthreads code that croaks on linux glibc tls.
374
375 2004-01-27 Frank Ch. Eigler <fche@redhat.com>
376
377 * testsuite/libmudflap.c/fail31-frag.c, pass45-frag.c: New tests.
378
379 2004-01-15 Frank Ch. Eigler <fche@redhat.com>
380
381 * testsuite/libmudflap.c/pass44-frag.c: New test.
382
383 2004-01-12 Frank Ch. Eigler <fche@redhat.com>
384
385 * testsuite/libmudflap.c/fail{28,29,30}-frag.c: New tests.
386
387 2004-01-08 Frank Ch. Eigler <fche@redhat.com>
388
389 * testsuite/libmudflap.c/pass43-frag.c: Added missing program rc.
390
391 2003-12-11 Frank Ch. Eigler <fche@redhat.com>
392
393 * testsuite/libmudflap.c/pass42-frag.c, pass43-frag.c: New tests.
394
395 2003-12-08 Andrew Pinski <pinskia@physics.uc.edu>
396
397 PR libmudflap/12670
398 * configure.in: Add check for see if
399 socklen_t typedef is in sys/socket.h.
400 * mf-hooks1.c: Add define if socklen_t
401 is not typedef.
402 * mf-hooks2.c: Likewise.
403 * mf-hooks3.c: Likewise.
404 * config.h.in: Regen.
405 * configure: Regen.
406
407 2003-12-08 Frank Ch. Eigler <fche@redhat.com>
408
409 * mf-runtime.c (__mf_watch_or_not): Tweak tracing message.
410 * testsuite/libmudflap.c/fail21-frag.c: Defeat aliasing
411 optimizations.
412 * testsuite/libmudflap.c/pass25-frag.c: Ditto.
413 * testsuite/libmudflap.c/pass26-frag.c: Tolerate non-overlapping
414 (unoptimized) allocation of stack space.
415
416 2003-12-07 Richard Henderson <rth@redhat.com>
417
418 * testsuite/libmudflap.c/fail23-frag.c (main): Adjust addend to 11.
419 * testsuite/libmudflap.c/fail27-frag.c (foo): Mark noinline.
420
421 2003-12-06 Andrew Pinski <apinski@apple.com>
422
423 partial PR libmudflap/12670
424 * mf-hooks1.c: Respect Darwin checks. Conditionalize POSIX_SOURCE.
425 * mf-hooks2.c: Likewise.
426 * mf-hooks3.c: Likewise.
427
428 2003-11-19 Frank Ch. Eigler <fche@redhat.com>
429
430 libstdc++/11696
431 * mf-runtime.h.in: Switch to #pragma redefine_extname for
432 symbols interposed at compile time.
433 * testsuite/libmudflap.c++/pass41-frag.cxx: New test.
434
435 libmudflap/12939
436 * mf-hooks2.c (semctl): Tolerate FreeBSD.
437
438 * configure.in: Reorganize check for <pthread.h>.
439 * configure: Regenerated.
440
441 2003-11-04 David Edelsohn <edelsohn@gnu.org>
442
443 * mf-runtime.c (_ALL_SOURCE): Define for AIX.
444 (_LARGE_FILE_API): Define for AIX.
445 * mf-hooks[123]: Same.
446 (_XOPEN_SOURCE_EXTENDED): Define to 1 for AIX.
447
448 2003-10-21 David Edelsohn <edelsohn@gnu.org>
449
450 * mf-runtime.c (_XOPEN_SOURCE_EXTENDED): Define to 1 for AIX.
451
452 2003-07-29 Frank Ch. Eigler <fche@redhat.com>
453
454 2003-07-29 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
455
456 * configure.in: Update check for union semun.
457
458 2003-07-29 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
459
460 PR other/11673
461 * mf-hooks2.c [WRAP_semctl]: Fix check for HAVE_UNION_SEMUN.
462
463 2003-07-29 Frank Ch. Eigler <fche@redhat.com>
464
465 PR other/11673
466 * configure.in: Add checks for 64-bit LFS functions, struct semun
467 definition, for BSD compatibility.
468 * mf-hooks1.c: Respect BSD checks. Conditionalize POSIX_SOURCE.
469 * mf-hooks2.c: Ditto. Include <strings.h> for bcmp* decls.
470 * mf-hooks3.c: Ditto.
471 (pthread_create): Try MAP_ANON on platforms without the MAP_ANONYMOUS
472 mmap flag.
473 * configure, config.h.in: Regenerated.
474
475 2003-07-23 Frank Ch. Eigler <fche@redhat.com>
476
477 Multithreading fixes:
478 * mf-runtime.c (__mf_object): Store allocating/deallocating
479 thread id.
480 (options): Support new "-thread-stack" option.
481 Rename "-heur-argv-environ" option to "-heur-stdlib".
482 Disable "-lc-mask" and "-lc-shift" options.
483 (__mf_dynamic): Add function pointers for pthread_join/_exit.
484 (__assert_fail): New self-contained function for glibc.
485 * mf-hooks3.c: Essentially rewritten, particularly related to
486 use of __mf_pthread_info array.
487 (pthread_join, _exit): New hook functions.
488 * mf-impl.h (BEGIN_PROTECT): Handle starting_p case.
489 * testsuite/libmudflap.cth/pass40-frag.c: New test.
490
491 Warning cleanups:
492 * mf-heuristics.c: Add type casts for tracing, sub calls.
493 * mf-impl.h (BEGIN_PROTECT): Redefine to omit result type.
494 Update all callers to declare explicit result holder.
495 (END_PROTECT): Removed.
496 * testsuite/*/*frags.exp: Clean up default MUDFLAP_OPTIONS.
497
498 2003-07-15 Diego Novillo <dnovillo@redhat.com>
499
500 * testsuite/libmudflap.c/fail21-frag.c: Add volatile modifiers.
501 * testsuite/libmudflap.c/fail15-frag.c: Likewise.
502 * testsuite/libmudflap.c/fail13-frag.c: Likewise.
503
504 2003-07-04 Frank Ch. Eigler <fche@redhat.com>
505
506 * mf-hooks1.c, 2.c, 3.c: New file, splits up content from old ...
507 * mf-hooks: Removed.
508 * mf-impl.h (MF_VALIDATE_EXTENT, BEGIN_PROTECT, END_PROTECT):
509 Move these macros from old mf-hooks.c here.
510 * Makefile.am: Adapt to split-up hook sources for faster builds.
511 * Makefile.in: Regenerated.
512
513 * mf-heuristics.c: Remove #if-0 block.
514
515 * mf-impl.h (__mf_state): Reorganize declaration and implementation.
516 (__mf_starting_p): New state only for use while dlsym bootstrapping.
517 (CALL_REAL, __mf_init): Corresponding changes.
518 (TRACE, VERBOSE_TRACE): Include thread id and "mf:" prefix. Update
519 all callers to remove redundant "mf:" prefix.
520 * mf-runtime.h.in: #define a few reentrancy macros for libmudflapth.
521 * mf-hooks3.c: Rewrite chunks to support per-thread __mf_state value.
522 (__mf_pthread_info): Become a hash table.
523
524 * testsuite/lib/mfdg.exp: Support new "dg-timeout" and
525 "dg-repetitions" directives to control test case execution.
526 * testsuite/libmudflap.cth/pass37-frag.c: Add timeout and repeat
527 options.
528 * testsuite/libmudflap.cth/pass39-frag.c: Ditto for this new test.
529
530 2003-06-25 Frank Ch. Eigler <fche@redhat.com>
531
532 * mf-hooks.c (alloca): Separate into stub.
533 (__mf_wrap_alloca_indirect): New function. Use CALL_REAL
534 malloc/free for alloca blocks.
535 (pthread_create): Tolerate failing pthread_attr_get* calls.
536 * mf-runtime.c (__mf_fini): Call __mf_wrap_alloca_indirect.
537 * mf-impl.h (CALL_WRAP): Remove macro.
538 * testsuite/libmudflap.c/pass21-frag.c: Include <alloca.h>.
539 * testsuite/libmudflap.c/pass23-frag.c: Include more struct
540 padding for ia64 BIT_FIELD_REF constructs.
541
542 2003-06-19 Frank Ch. Eigler <fche@redhat.com>
543
544 * mf-hooks.c (struct pthread_info): Add "thread_errno" field.
545 (__mf_pthread_spawner, __mf_pthread_cleanup): Use it with GUESS
546 libmudflap object type.
547 * mf-runtime.c (__mfu_unregister): Correct cemetary logic to avoid
548 crashes on unregistering STATIC objects.
549
550 2003-06-17 Frank Ch. Eigler <fche@redhat.com>
551
552 Based on patch from Eyal Lebedinsky <eyal@eyal.emu.id.au>:
553 * mf-hooks.c (__mf_pthread_spawner): Register thread errno.
554 (time, strerror, fopen, fopen64, fclose, fread): New hooks.
555 (fwrite, fgetc, fgets, getc, gets, ungetc, fputc): New hooks.
556 (fputs, putc, puts, clearerr, feof, ferror, fileno): New hooks.
557 (printf, fprintf, sprintf, snprintf, vprintf, vfprintf): New hooks.
558 (vsprintf, vsnprintf, access, remove, fflush, fseek): New hooks.
559 (fseeko64, ftell, ftello64, rewind, fgetpos, fsetpos): New hooks.
560 (stat, stat64, fstat, lstat, mkfifo, setvbuf, setbuf): New hooks.
561 (setvbuf, opendir, closedir, readdir, recv, recvfrom): New hooks.
562 (recvmsg, send, sendto, sendmsg, setsockopt, getsockopt): New hooks.
563 (accept, bind, connect, gethostname, sethostname): New hooks.
564 (gethostbyname, wait, waitpid, popen, pclose, execve): New hooks.
565 (execv, execvp, system, dlopen, dlclose, dlerror, dlsym): New hooks.
566 (semop, semctl, shmctl, shmat, shmdt): New hooks.
567 * mf-runtime.h.in: Corresponding changes.
568 * mf-runtime.c (__mf_ini): Register stdio objects. Use STATIC type.
569 (opts) Rename heur_argv_environ to heur_std_data.
570 (__mf_wrap_main): Use STATIC type for argv/environ strings.
571 * Makefile.am: Corresponding changes.
572 * Makefile.in: Regenerated.
573
574 2003-06-11 Frank Ch. Eigler <fche@redhat.com>
575
576 * mf-heuristics.c (__mf_heuristic_check): Disable stack_bounds
577 heuristic for threaded case, and for non-x86-linux targets.
578 * mf-hooks.c (__mf_0fn_calloc): Provide a working dummy implementation
579 for use during pre-main() program startup.
580 (__mf_0fn_*): Make these functions non-static.
581 * mf-impl.h (DECLARE, CALL_REAL): Support calls to 0fn backup hook
582 functions.
583 * mf-runtime.c (__mf_state): Set initial state to "starting".
584 (__mf_resolve_single_dynamic): Tolerate repeated calls for same symbol.
585 (__wrap_main): New function to register argv[] and environ[] strings.
586 (__mf_ini): Call it.
587 (*): In all trace functions, use "%p" as formatter for uintptr_t.
588
589 * testsuite/libmudflap.c/pass38-frag.c: New test case.
590 * testsuite/libmudflap.cth/pass37-frag.c: Improved test.
591
592 * acinclude.m4: Add comments with aoliva's concerns about x86_64
593 pass_all.
594 * aclocal.m4, configure: Regenerated.
595
596 2003-06-04 Frank Ch. Eigler <fche@redhat.com>
597
598 * acinclude.m4: Correct typo in AC_MSG_CHECKING.
599 * aclocal.m4, configure: Regenerated.
600
601 2003-06-03 Frank Ch. Eigler <fche@redhat.com>
602
603 * acinclude.m4: Force "pass_all" deplibs_check_method for libtool
604 for x86_64 target. Disable caching for this value.
605 * aclocal.m4, configure: Regenerated.
606
607 2003-06-02 Frank Ch. Eigler <fche@redhat.com>
608
609 * testsuite/libmudflap.c/pass38-frag.c: Deleted. -fwritable-strings
610 is about to become deprecated, and its present handling bugs are
611 unworthy of fixing.
612
613 2003-05-30 Frank Ch. Eigler <fche@redhat.com>
614
615 * testsuite/libmudflap.c/pass38-frag.c: New test for
616 -fwritable-strings.
617
618 2003-05-23 Frank Ch. Eigler <fche@redhat.com>
619
620 * mf-runtime.c (__mf_sigusr1_handle): Call unlocked variant of
621 __mf_report, asserting reentrant calling context.
622
623 2003-05-23 Frank Ch. Eigler <fche@redhat.com>
624
625 * mf-hooks.c (realloc): Correct reentrancy logic.
626 * testsuite/libmudflap.c/hook-allocstuff.c: New test case.
627
628 2003-05-20 Frank Ch. Eigler <fche@redhat.com>
629
630 * mf-hooks.c (LIBMUDFLAPTH_THREADS_MAX): New macro, replaces
631 PTHREAD_THREADS_MAX. Update users.
632 * mf-runtime.c (__mf_usage): Print [active] instead of [default]
633 for active options.
634 * testsuite/Makefile.am (all-local): Prime dejagnu site.exp file
635 with libmudflapth presence indicator.
636 * testsuite/Makefile.in: Regenerated.
637
638 2003-05-16 Frank Ch. Eigler <fche@redhat.com>
639
640 * Makefile.am (AM_CFLAGS): Remove "-ansi".
641 * configure.in: Remove silly no-pthreads => no-shared logic.
642 * Makefile.in, configure: Regenerated.
643 * mf-heuristics.c (__mf_heuristic_check): Remove reentrancy hacks.
644 * mf-hooks.c (BEGIN_PROTECT, END_PROTECT): Reorganize reentrancy
645 code. Count reentrancy events.
646 (all hook functions): Don't directly manipulate __mf_state variable.
647 Add TRACE calls to hook functions without them.
648 * mf-impl.h (LOCKTH): Try to count lock contention events.
649 (VERBOSE_TRACE, TRACE): Remove reentrancy hacks.
650 * mf-runtime.c (BEGIN_RECURSION_PROTECT, END_RECURSION_PROTECT):
651 Reorganize reentrancy code.
652 (external __mf_ entry points): Use RECURSION_PROTECT mechanism to
653 identify reentrancy with mutex holding times.
654 (internal __mfu_ entry points): Remove internal reentrancy code.
655 (__mf_init): Use ordinary locked calls.
656 (__mfu_report): Print the two new counts.
657 * testsuite/lib/libmudflap.exp: Filter out junk ld/pthreads messages.
658 * testsuite/libmudfap.cth/cthfrags.exp: New test driver.
659 * testsuite/libmudflap.cth/pass37-frag.c: New pthreads test.
660 * testsuite/libmudfap.cth/cfrags.exp: Adapt to new libmudflap
661 option defaults.
662
663 2003-05-09 Frank Ch. Eigler <fche@redhat.com>
664
665 * configure.in: Add pthread support, plus glibc and porting hacks.
666 * Makefile.am (LIBMUDFLAPTH): New conditional, to build -lmudflapth
667 from objects built into ./pth/.
668 * mf-runtime.c (__mfu_watch,register,...): Fork new unlocked
669 functions for internal entry points. Update callers to pick
670 locked vs. unlocked variants.
671 (__mf_resolve_single_dynamic): Extend to support symbol versioning
672 info coming in from a static data structure.
673 (*): Reorder miscellaneous declarations to group data vs functions.
674 (__mf_set_default_options): Simplify.
675 (__mf_usage): Mention threading status of host executable.
676 * mf-impl.h: Move max/min decls here. Reorganize __mf_dynamic
677 decls to match above.
678 (LOCKTH, UNLOCKTH): New macros for Big Libmudflap Lock management.
679 * mf-heuristics.c: Choose between locked/unlocked calls. Add
680 some lock/unlock markers. Remove some unused code.
681 * mf-hooks: Ditto.
682 (pthread_create): New hook function.
683 (__mf_pthread_cleanup, _spawner): New helper functions.
684 * configure. aclocal.m4, config.h.in, Makefile.in: Regenerated.
685
686 2003-05-02 Frank Ch. Eigler <fche@redhat.com>
687
688 * testsuite/libmudflap.c/fail27-frag.c: Add more volatile flags.
689
690 2002-04-28 Frank Ch. Eigler <fche@redhat.com>
691
692 * Makefile.am (HOOKOBJS): Add *time related hooks.
693 * configure.in: Look for pthreads.h header.
694 * mf-hooks.c (asctime, ctime, gmtime, localtime): New wrappers.
695 * mf-runtime.c: Begin sketching some pthreads support.
696 (__mf_usage): Check for -lpthread presence.
697 (__mf_unregister): Confirm matching unregistration base.
698 (__mf_find_objects_rec): Reduce unnecessary recursion.
699 * mf-runtime.h.in: Add "nothrow" attribute to functions. Add
700 #defines for new hook functions.
701 * mf-impl.h: Corresponding changes.
702 * config.h.in, configure, Makefile.in: Regenerated.
703
704 2002-04-27 Diego Novillo <dnovillo@redhat.com>
705
706 * testsuite/libmudflap.c/fail1-frag.c: Add volatile
707 modifiers to prevent being optimized away.
708 * testsuite/libmudflap.c/fail10-frag.c: Likewise.
709 * testsuite/libmudflap.c/fail13-frag.c: Likewise.
710 * testsuite/libmudflap.c/fail14-frag.c: Likewise.
711 * testsuite/libmudflap.c/fail15-frag.c: Likewise.
712 * testsuite/libmudflap.c/fail2-frag.c: Likewise.
713 * testsuite/libmudflap.c/fail20-frag.c: Likewise.
714 * testsuite/libmudflap.c/fail3-frag.c: Likewise.
715
716 2003-04-15 Frank Ch. Eigler <fche@redhat.com>
717
718 * Makefile.am (libmudflap_la_LIBADD): Remove -ldl.
719 * configure.in: Look for uintptr_t and -ldl on target.
720 * mf-runtime.h.in: Adjust uintptr_t declaration logic.
721 * Makefile.in, aclocal.m4, configure, config.h.in: Regenerated.
722 * testsuite/Makefile.in: Regenerated.
723 * mf-runtime.c (__mf_sigusr1_respond): Tweak declaration and calls
724 for better C compliance.
725
726 2003-04-15 Frank Ch. Eigler <fche@redhat.com>
727
728 * mf-hooks.c (MF_VALIDATE_EXTENT): Remove unnecessary reentrancy
729 prevention code.
730 * mf-runtime.c (__mf_set_default_options): Turn off
731 check-initialization.
732 (__mf_describe_object): Shorten description.
733 * testsuite/libmudflap.c/fail25-frag.c: Turn on check-initialization.
734
735 2003-04-07 Frank Ch. Eigler <fche@redhat.com>
736
737 * mf-hooks.c (__mf_0fn_mmap): Correct return value, as per <rth>.
738
739 2003-04-02 Frank Ch. Eigler <fche@redhat.com>
740
741 * mf-hooks.c (BEGIN_PROTECT): Handle startup-time reentrant
742 calls specially.
743 (__mf_0fn_malloc ... _munmap): New dummy backup calls.
744 * mf-impl.h (CALL_BACKUP): New macros.
745 * mf-runtime.c (__mf_init): Tweak __mf_state during startup.
746
747 2003-03-31 Frank Ch. Eigler <fche@redhat.com>
748
749 * Makefile.am (AM_CFLAGS): Remove optimization flags.
750 (HOOKOBJS): Remove dlopen hook.
751 (libmudflap_la_LIBADD): Add -ldl.
752 * mf-hooks.c (dlopen): Remove hook.
753 * mf-impl.h (__mf_dynamic): Ditto.
754 * mf-runtime.c (__mf_resolve_dynamics): Ditto.
755 * Makefile.in: Regenerated.
756
757 2003-03-28 Frank Ch. Eigler <fche@redhat.com>
758
759 * configure.in: Check for target gettimeofday, signal, some headers.
760 * mf-impl.h (__mf_opts): Add new "sigusr1_report" field. Comment
761 out inop multi_threaded field.
762 * mf-runtime.c (options): Handle new "-sigusr1-report" option.
763 (__mf_set_options): Correct handling of "-help".
764 (__mf_sigusr1_respond): New function to manage SIGUSR1 response.
765 (__mf_check, __mf_register, __mf_unregister): Call it.
766 (__mf_insert_new_object, __mf_unregister): Respect HAVE_GETTIMEOFDAY.
767 (__mf_report_leaks): Make callable
768 (__mf_tree_analyze): Traverse in-order. Accumulate address bit
769 distribution statistics.
770 (__mf_adapt_cache): Rewrite shift guessing logic based on address
771 bit distributions.
772 * config.h.in, configure: Regenerated.
773 * testsuite/libmudflap.c/fail27-frag.c: New test.
774 * testsuite/libmudflap.c/pass36-frag.c: New test.
775
776 2003-03-11 Frank Ch. Eigler <fche@redhat.com>
777
778 * mf-runtime.h.in: Tweak.
779 * Makefile.am, configure.in: Tweak mf-runtime.h generation some more.
780 Don't use intermediate files nor AC_OUTPUT-time postprocessing.
781 * Makefile.in, testsuite/Makefile.in, configure: Regenerated.
782
783 2003-03-10 Frank Ch. Eigler <fche@redhat.com>
784
785 * configure.in: Tweak generation of mf-runtime.h some more. It
786 needs to work from both config.status and configure.
787 * configure: Regenerated.
788
789 2003-03-10 Frank Ch. Eigler <fche@redhat.com>
790
791 * Makefile.am: Reorganize hook file building. Add auto dependencies.
792 * configure.in: Tweak generation of mf-runtime.h.
793 * mf-runtime.h.in: Add new __MF_TYPE_HEAP_I.
794 * mf-hooks.c (*): Adapt to initialized-heap object type.
795 * mf-impl.h: Tweak cemetary boundaries.
796 * mf-runtime.c (__mf_check): Adapt to new initialized-heap object
797 type.
798 (__mf_insert_new_object, __mf_register, __mf_unregister): Ditto.
799 (__mf_describe_object, __mf_report_leaks, __mf_violation): Ditto.
800 * testsuite/lib/libmudflap.exp (includes): Include build tree.
801 * testsuite/libmudflap.c/pass{26,5}: Further adapt to initialization
802 checking.
803 * testsuite/.../fail{25,26}-frag.c: New tests.
804 * testsuite/.../pass{32,33,34,35}-frag.c: New tests.
805 * Makefile.in, configure: Regenerated.
806
807 2003-03-05 Frank Ch. Eigler <fche@redhat.com>
808
809 * mf-runtime.c (__mf_set_default_options): Turn on initialization
810 checking by default.
811 (__mf_insert_new_object): As a temporary hack, assume that new
812 objects registered on the stack start out initialized.
813 * testsuite/libmudflap.c/fail9,pass23,pass[6789]-*: Initialize
814 heap objects by hand.
815
816 2003-03-05 Frank Ch. Eigler <fche@redhat.com>
817
818 Switch to macro-style hooks for str*/mem*/b* functions.
819 * mf-runtime.h.in (__MF_TYPE_*): Moved some internal values out.
820 (mem*, str*, b*): Added macro-style hooks for _MUDFLAP case.
821 * mf-runtime.c: #include config.h to enable glibc backtraces again.
822 (__mf_set_default_options): Turn off heur_proc_map.
823 (*): Adapt to to macro-style hook functions.
824 (__mf_object_dead_head, __mf_object_cemetary): Correct bounds.
825 (__mf_check, __mf_register, __mf_unregister): Tweak tracing message.
826 (__mf_violation): Handle __MF_VIOL_WATCH.
827 * mf-impl.h (__MF_TYPE_*): Moved these internal values here.
828 (__mf_dynamic): Removed mem*/str*/b* functions.
829 (TRACE, VERBOSE_TRACE): Add reentrancy locking.
830 (WRAPPER2): New macro for macro-style hooks.
831 * mf-hooks.c: Convert mem*/str*/b* functions to simpler
832 macro-style hooks.
833 (BEGIN_PROTECT): Tweak tracing vs reentrancy-lock ordering.
834 * mf-heuristics.c: Adapt to macro-style hook functions.
835 Correct some comments.
836 * testsuite/lib/mfdg.exp (dg-test): Simplify result string for
837 output pattern tests.
838 * testsuite/libmudflap.c/fail[89]-frag.c: Elaborate output test.
839 * testsuite/libmudflap.c++/c++frags.exp: Enable non-static tests.
840
841 2003-02-28 Frank Ch. Eigler <fche@redhat.com>
842
843 * testsuite/libmudflap.c/fail23-frag.c, pass30-frag.c: New tests
844 for global array registration.
845 * testsuite/libmudflap.c++/fail24-frag.cxx, pass31-frag.cxx: Ditto.
846 * testsuite/libmudflap.c++/c++frags.exp: Tweak -static multilib hack.
847
848 2003-02-27 Frank Ch. Eigler <fche@redhat.com>
849
850 * Makefile.am: Add gross make bug workarounds. Tweaked
851 SUBDIRS and AM_CFLAGS.
852 * Makefile.in: Regenerated.
853
854 2003-02-26 Frank Ch. Eigler <fche@redhat.com>
855
856 Switch to dejagnu.
857 * configure.in (AC_PROG_CXX): Don't look for C++ any more.
858 * Makefile.am (TESTS): Remove simple automake testing.
859 * configure, Makefile.in: Regenerated.
860 (SUBDIRS): Include new testsuite/ directory.
861 * tests/*: Removed all files; moved bulk under:
862 * testsuite/*: New subdirectory tree.
863 * testsuite/libmudflap.c/cfrags.exp: New file, C test driver.
864 * testsuite/libmudflap.c++/c++frags.exp: New file, C++ test driver.
865 * testsuite/lib/libmudflap.exp: New file, derived from libstdc++.
866 * testsuite/lib/mfdg.exp: New file, derived from dejagnu.
867 * testsuite/config/default.exp: New file.
868 * testsuite/Makefile.am, Makefile.in: New files.
869
870 2003-01-29 Frank Ch. Eigler <fche@redhat.com>
871
872 * Makefile.am (TESTS_ENVIRONMENT): Remove redundant "-mode-check".
873 (TESTS): Add fail22 and pass29 tests.
874 * mf-runtime.h.in: Change API to take void*/size_t region parameters.
875 Add new access-type parameter for __mf_check. Move __MF_VIOL* out.
876 * mf-impl.h: Corresponding changes. Update CLAMP* macros for void*
877 values. Move __MF_VIOL* here.
878 * mf-runtime.c (*): Adapt to void*/size_t API in mf-runtime.h.
879 (check_initialization): New field in __mf_opts. Default off.
880 (read_count,write_count): New fields in __mf_object.
881 (__mf_check): Implement basic initialization checking.
882 (__mf_insert_new_object): Assume STATIC|GUESS regions are initialized.
883 (__mf_describe_object): Print new fields.
884 (__mf_violation): Identify check/read vs. check/write in messages.
885 * test/pass29-frag.c, test/fail22-frag.c: Basic tests for new
886 "-check-initialized" mudflap option.
887 * test/pass25-frag.c, test/fail21-frag.c: Adapt to API changes.
888 * mf-hooks.c (MF_VALIDATE_EXTENT): Add new access-type parameter.
889 Drop __FILE__/__LINE__ hack. Update callers.
890 (*): Adapt to new mf-runtime.h API.
891 * Makefile.in: regenerated.
892
893 2003-01-24 Frank Ch. Eigler <fche@redhat.com>
894
895 * configure.in: Build mf-runtime.h a more proper way.
896 * mf-hooks.c (strdup, strndup): Correct reentrancy logic.
897 * mf-runtime.c (verbose_violations): Turn on by default.
898 * mf-runtime.h.in: Remove some miscellaneous stuff ...
899 * mf-impl.h: ... and move it here.
900 * configure: Regenerated.
901
902 2003-01-22 Frank Ch. Eigler <fche@redhat.com>
903
904 * configure.in: Look for C++ compiler.
905 * test/*-frag.c, mf-driver.c: Reformatted with GNU indent and
906 fixed type warnings when built with C++.
907 * test/pass27-frag.cxx, pass28-frag.cxx: New C++ tests.
908 * Makefile.am (TESTS): Run them.
909 (*) Add new rules for building and running C++ tests.
910 (TESTFLAGS): Set new default to avoid libstdc++-v3 shlib issues.
911 * mf-runtime.h.in: Protect with extern "C".
912 * Makefile, configure: Regenerated.
913
914 2003-01-06 Frank Ch. Eigler <fche@redhat.com>
915
916 Portability improvements.
917 * configure.in: Look for glibc backtrace headers/functions.
918 * mf-hooks.c: Don't include <execinfo.h> any more.
919 * mf-runtime.c (__mf_set_options): Call more stdlib functions
920 via CALL_REAL.
921 (__mf_backtrace): Provide alternate baby implementation in
922 absence of glibc.
923 * test/mf-driver.c: Portability tweaks.
924 * acinclude.m4: New file, containing top level libtool.m4.
925 * aclocal.m4, configure, Makefile.in, config.h.in: Regenerated.
926
927 2002-12-19 Frank Ch. Eigler <fche@redhat.com>
928
929 * mf-runtime.h.in (HAVE_UINTPTR_T): Define unconditionally.
930
931 2002-11-08 Frank Ch. Eigler <fche@redhat.com>
932
933 * mf-runtime.c (options): Add new "wipe-heap", "wipe-stack"
934 options.
935 (__mf_unregister): Implement stack/heap object wiping.
936 (__mf_set_options): Renamed from __mf_process_opts.
937 (__mf_uncache_object): Change arg type, correct callers.
938 * mf-impl.h: Corresponding changes.
939 * mf-hooks.c (realloc): Save/restore heap-wiping flag.
940 * mf-runtime.h.in (__mf_set_options): Extend public API.
941 * test/pass26-frag.c: New test for stack wiping.
942 * Makefile.am (TESTS): Run it.
943 * Makefile.in: Regenerated.
944
945 2002-11-07 Frank Ch. Eigler <fche@redhat.com>
946
947 * mf-runtime.h.in (__mf_watch, __mf_unwatch): Extend public API.
948 * mf-runtime.c (__mf_object_t): Add watching_p field.
949 (__mf_watch_or_not): New function to implement
950 object watch flagging.
951 (__mf_watch, __mf_unwatch): New wrappers for above.
952 (__mf_check, __mf_describe_object): Handle objects with watching_p.
953 (__mf_count_violation): Enlarge array.
954 (__mf_uncache_object): Renamed from __mf_remove_old_object. Don't
955 unlink object. Clear cache properly.
956 (__mf_unregister): Unlink object explicitly before uncaching.
957 * test/fail21-frag.c, pass25-frag.c: New tests.
958 * Makefile.in, aclocal.m4: Regenerated.
959
960 2002-11-05 Frank Ch. Eigler <fche@redhat.com>
961
962 * test/fail20-frag.c: New test for NULL pointer dereferencing.
963 * Makefile.am (TESTS): Add it.
964 * test/pass-stratcliff.c: Add decls of stpcpy.
965 * configure.in: Test for <stdint.h>. Generate mf-runtime.h in
966 build tree from config.h and new file mf-runtime.h.in.
967 * mf-runtime.h.in: Renamed from mf-runtime.h. Tweak uintptr_t decl.
968 * Makefile.in, configure, config.h.in: Regenerated.
969 * mf-hooks.c: Add #undef for wrapped glibc str*/mem* macros.
970 * mf-runtime.c (options, __mf_set_default_options): Support new
971 default "abbreviate" option.
972 (__mf_object.description_epoch): New field.
973 (__mf_describe_object): Conditionally abbreviate objects already
974 displayed in current epoch. Accept NULL input to increment epoch.
975 (__mf_fini, __mf_ini): Reset description epoch.
976 (__mf_register, __mf_unregister, __mf_adapt_cache, __mf_init): Ensure
977 that NULL pointer slot in lookup cache is invalidated. Register a
978 NOACCESS region around NULL.
979 * mf-impl.h: Corresponding changes.
980
981 2002-10-16 Frank Ch. Eigler <fche@redhat.com>
982
983 * test/fail19-frag.c, pass24-frag.c, pass-stratcliff.c: New tests.
984 * Makefile.am: Run them. Install mf-runtime.h.
985 * Makefile.in: Regenerated.
986 * mf-hooks.c: Add some markers for more missing functions.
987 * mf-runtime.c (__mf_adapt_cache): Experiment with a utilization-based
988 statistic to tune tune cache size (mask).
989
990 2002-10-01 Frank Ch. Eigler <fche@redhat.com>
991
992 * test/pass23-frag.c: New test for bit_field_ref expressions.
993 * Makefile.am, Makefile.in: Add new test.
994 * mf-hooks.c (mmap, munmap): Rewrite to track individual pages.
995 (MF_VALIDATE_EXTENT): Accept zero-size mem/str operations.
996 * mf-runtime.c (__mf_init): Register errno global.
997 (__mf_find_object): Removed function.
998 (__mf_check): Rewrite logic to support accesses across some
999 contiguous but distinctly registered objects.
1000 (__mf_remove_old_object): Tolerate cache entries that span
1001 contiguous objects.
1002
1003 2002-09-30 Frank Ch. Eigler <fche@redhat.com>
1004
1005 * test/pass21-frag.c, pass22-frag.c: New tests: alloca, bitfields.
1006 * Makefile.am, Makefile.in: Run new tests.
1007 * mf-hooks.c (alloca): Correct stack direction logic.
1008
1009 2002-09-26 Frank Ch. Eigler <fche@redhat.com>
1010
1011 * mf-impl.h (adapt_cache): New option.
1012 * mf-runtime.c (__mf_set_default_options): Set its default value.
1013 Tweak the tree_aging parameter down.
1014 (__mf_check): Maintain separate counter for cache-adaptation.
1015 (__mf_tree_analyze): New function to collect object tree stats.
1016 (__mf_adapt_cache): New function to automate cache parameters.
1017
1018 2002-09-24 Frank Ch. Eigler <fche@redhat.com>
1019
1020 * mf-heuristics.c (__init_misc, __mf_heuristic_check): Add
1021 hypothetical #if-0'd argv/envp region registration.
1022 * mf-runtime.c (__mf_init): Add kludged form of above.
1023 (*) Add "heur_argv_environ" flag, default on, to govern this.
1024 * mf-impl.h: Corresponding changes.
1025
1026 2002-09-20 Frank Ch. Eigler <fche@redhat.com>
1027
1028 * test/fail18-frag.c: New test file for NOACCESS regions.
1029 * Makefile.am (TESTS): Add new test.
1030 * Makefile.in: Regenerated.
1031
1032 * mf-heuristics.c (__mf_heuristics_check): Correct deja_vu logic.
1033 * mf-impl.h (tree_aging): Add new mudflap_option, default 1000000.
1034 (optimize_object_tree): Remove unused mudflap_option.
1035 * mf-runtime.h (__MF_TYPE_NOACCESS): New region type. Add printing
1036 support throughout. Use .._MAX_CEM for cemetary upper bound.
1037 * mf-runtime.c (__mf_init): Register __mf_* globals as NOACCESS
1038 regions.
1039 (__mf_object): Add new liveness field for use by tree aging.
1040 (__mf_check): Trigger tree aging when needed.
1041 (__mf_age_tree): New function to decay liveness field.
1042 (__mf_find_objects_rec): Use liveness field to rotate tree.
1043 (__mf_insert_new_object): Only provide backtrace for HEAP objects.
1044 (__mf_unregister): Ditto.
1045 (__mf_register): Tweak duplicate-static message.
1046 (__mf_violation: Tweak nearby-object counter printing.
1047
1048 2002-09-16 Frank Ch. Eigler <fche@redhat.com>
1049
1050 * test/pass20-frag.c: New test file.
1051 * Makefile.am (TESTS): Reorganize. Add pass20 test.
1052 * Makefile.in: Regenerated.
1053
1054 * mf-impl.h (TRACE_IN, TRACE_OUT): Remove macros. Update callers.
1055 * mf-hooks.c (BEGIN_PROTECT): Add hook tracing here.
1056 * mf-heuristic.c (__mf_heuristic_check): Track seen /proc/self/map
1057 entries to avoid repeat registration.
1058 * mf-runtime.c (__mf_object_cemetary): Don't bother bury GUESS regions.
1059 (__mf_register, __mf_unregister): Rewrite GUESS handling logic.
1060
1061 2002-09-09 Frank Ch. Eigler <fche@redhat.com>
1062
1063 * Makefile.am: Create test sources with #include, not cat>>.
1064 * Makefile.in: Regenerated.
1065 * test/buildtest.sh: Removed.
1066 * test/driver.c (abort_handler, main): Be quiet.
1067
1068 2002-09-06 Frank Ch. Eigler <fche@redhat.com>
1069
1070 * test/pass18-frag.c, pass19-frag.c: New tests.
1071 * Makefile.am (check): Run them. Rebuild test programs each time.
1072 * Makefile.in: Regenerated.
1073
1074 2002-09-06 Frank Ch. Eigler <fche@redhat.com>
1075
1076 * mf-runtime.c (__mf_register): Correct SEGV-inducing error in
1077 overlapping object search.
1078 (__mf_violation): Likewise for nearby objects.
1079 Improve nearby-object listing.
1080
1081 cleanup:
1082 * mf-runtime.c, mf-hooks.c: Remove "{{{"/"}}}" folding marks.
1083 * mf-heuristics.c (__mf_heuristic_check): Tweak message.
1084
1085 2002-09-03 Frank Ch. Eigler <fche@redhat.com>
1086
1087 alloca support:
1088 * Makefile.am (AM_CFLAGS): New definition of needed settings.
1089 (HOOKOBJS): Add alloca-hook.o.
1090 * mf-hooks.c (alloca): New function to implement alloca in libiberty
1091 style.
1092 * mf-runtime.c (__mf_report): Call alloca(0) to flush remaining blocks.
1093 (__mf_backtrace): Reimplement without using alloca.
1094 * Makefile.in: Regenerated.
1095
1096 cleanup:
1097 * mf-hooks.c: Use VERBOSE_TRACE throughout instead of fprintf(stderr).
1098 Correct signedness bugs in length-tracking variables.
1099 * mf-impl.h: Make options unsigned.
1100 (CALL_WRAP): New macro to parallel CALL_REAL().
1101 (DECLARE): Remove erroneous ";" at end.
1102 * mf-runtime.c, mf-hooks.c, mf-heuristics.c: Replace remaining %p
1103 formatting specs with %08lx. Correct several compiler warnings.
1104
1105 2002-08-28 Frank Ch. Eigler <fche@redhat.com>
1106
1107 * mf-runtime.c (__mf_violation): Try harder to locate nearby objects.
1108
1109 2002-08-27 Frank Ch. Eigler <fche@redhat.com>
1110
1111 libmudflap hook breakup:
1112 * Makefile.am (TESTS_ENVIRONMENT): Add ../../gcc to LD_LIBRARY_PATH
1113 for libgcc_s.
1114 (TESTS): Make dependent on libmudflap.
1115 (HOOKOBJS): Break up mf-hooks.o into many little hook objects,
1116 compiled from segments of mf-hooks.c.
1117 * mf-hooks.c: Corresponding changes: wrap each function in
1118 #ifdef/#endif.
1119 * Makefile.in: Regenerated.
1120
1121 Heuristics reorganization:
1122 * mf-heuristics.c (__mf_register_ro_sections, __mf_init_heuristics):
1123 Remove these functions. Update callers.
1124 (__mf_heuristic_check): Incorporate all the various heuristics.
1125 Encode cacheability/retry judgement into trinary return value.
1126 Separate start-end logic into a separate fallback heuristic. Only
1127 register relevant /proc/self/map segments.
1128 * mf-impl.h: Corresponding changes.
1129 * mf-runtime.c (__mf_check): Reorganize heuristics fallback logic.
1130 (__mf_init): Don't call __mf_init_heuristics.
1131
1132 Tracing cleanup:
1133 * mf-heuristics.c, mf-runtime.c: Use new MUDFLAP_OPTION
1134 "-verbose-trace" to emit all tracing messages other than those of
1135 basic public api. Eliminate some duplicate/excessive messages.
1136 * mf-runtime.h: Corresponding changes.
1137
1138 2002-08-27 Graydon Hoare <graydon@redhat.com>
1139
1140 * mf-impl.h (WRAPPER): Change to create linker aliases for __wrap
1141 and __real when compiled with -DPIC.
1142 * mf-hooks.c (WRAPPER): Change all uses of WRAPPER macro slightly.
1143 * Makefile.am (AUTOMAKE_OPTIONS): Fix LD_LIBRARY_PATH for tests.
1144 * Makefile.in: Regenerate.
1145
1146 2002-08-26 Graydon Hoare <graydon@redhat.com>
1147
1148 * mf-impl.h: New file, private implementation header.
1149 * mf-runtime.h: Reorganize a bit.
1150 (CLAMPSZ): Fix arithmetic.
1151 (__MF_CACHE_MISS_P): Fix arithmetic.
1152 * mf-runtime.c: Reorganize a bit.
1153 (__mf_dynamic): New structure.
1154 (resolve_single_dynamic): New function.
1155 (__mf_resolve_dynamics): New function.
1156 (__mf_init): Initialize dynamic wrappers.
1157 * mf-hooks.c: Macro-ize __real calls.
1158 Clamp various bits of arithmetic.
1159 Add explicit __mf_check call contexts.
1160 * Makefile.am: Add dependencies on mf-impl.h
1161 * Makefile.in: Regenerate.
1162 * configure.in: Comment out shared override.
1163 * configure: Regenerate.
1164
1165 2002-08-22 Graydon Hoare <graydon@redhat.com>
1166
1167 * mf-runtime.c (__mf_process_opts): Sanity-check free_queue_length.
1168 (__mf_check): Re-inialize and check heuristics before violation.
1169 (__mf_register): Permit updating pure-guess regions.
1170 * mf-hooks.c (__wrap_free): Correct some free queue logic.
1171 (__wrap_dlopen): New wrapper function.
1172 (__wrap_mmap): New wrapper function.
1173 (__wrap_munmap): New wrapper function.
1174 * mf-heuristics.c (__mf_register_ro_sections): Register *all* regions
1175 which are not stack addresses.
1176 (is_stack_address): New function.
1177 (__mf_init_heuristics): Save and restore state, always initialize with
1178 "starting" state.
1179
1180 2002-08-21 Frank Ch. Eigler <fche@redhat.com>
1181
1182 * mf-hooks.c (MF_VALIDATE_EXTENT): Rewrite to correct off-by-one
1183 error. Pass location string.
1184 (wrap_strcpy, wrap_strncpy): Remove extra %s in trace strings.
1185 * mf-runtime.c (options): Add lc-mask, lc-shift options.
1186 (__mf_process_opts): Apply some sanity checking for lc-mask.
1187 (__mf_check, __mf_violation): Take new location-string argument.
1188 Update callers to pass NULL if necessary.
1189 (__mf_backtrace): New smart backtracer function. Calls replace
1190 several ad-hoc blocks elsewhere.
1191 (__mf_describe_object): Remove bad reentrancy test. Improve
1192 tracing message.
1193 * mf-runtime.h: Corresponding changes. Public/private markup.
1194 (__MF_CACHE_MISS_P): New macro.
1195
1196 2002-08-20 Graydon Hoare <graydon@redhat.com>
1197
1198 * mf-runtime.h: New option: stack_bound (heuristic).
1199 Move some macros out of implementation files.
1200 * mf-runtime.c: New option string: -stack-bound.
1201 Unify recursion protection with hooks.
1202 Add more logging.
1203 (__mf_check): Call __mf_heuristic_check.
1204 (__mf_process_opts): Fix "no-" processing.
1205 * mf-heuristics.c (__mf_heuristic_check): New function.
1206 * mf-hooks.c: Much off-by-one fixing, recursion protection.
1207
1208 2002-08-20 Frank Ch. Eigler <fche@redhat.com>
1209
1210 Option parsing improvements, region splitting bug fixes:
1211 * mf-heuristics.c (__mf_register_ro_sections): Add warned casts.
1212 * mf-runtime.h (heur_proc_map): New libmudflap option.
1213 * mf-runtime.c (__mf_set_default_options): Set it.
1214 (__mf_usage): Print default values/status.
1215 (__mf_process_opts): Support general "no-" option string prefix.
1216 (__mf_init): Print __mf_usage on unknown-option error.
1217 (__mf_register): Print trace message up front.
1218 Correct region splitting logic for case where a subregion disappears.
1219 Correct memory leak.
1220 (__mf_violation): Make even basic message conditional on option.
1221
1222 Build cleanup:
1223 * Makefile.am (TESTS_ENVIRONMENT): Add -no-heur-proc-map.
1224 (clean-local): New target.
1225 (test/*x rules): Add -g CFLAGS.
1226 (CFLAGS): Add -freorder-blocks.
1227 (MFCONFIG_CFLAGS, INCLUDE): Remove unneeded settings.
1228 * Makefile.in: Regenerated.
1229 * Makefile, mf-config.h: Removed files.
1230
1231 2002-08-16 Graydon Hoare <graydon@redhat.com>
1232
1233 * mf-runtime.c (__mf_insert_new_object): Factor out of
1234 __mf_register.
1235 (__mf_remove_old_object): Factor out of __mf_unregister.
1236 (__mf_register): Handle guessed regions, splitting
1237 guesses when new registrations arrive.
1238 (__mf_unregister): Do not unregister guesses.
1239 * mf-runtime.h: Move convenience macros around,
1240 declare new option fields. Add __MF_TYPE_GUESS.
1241 * mf-hooks.c (__wrap_*alloc): Use crumple zones.
1242 (__wrap_free): Call __real_free for deferred frees.
1243 * Makefile.am: Add more tests, fix dependency.
1244 * Makefile.in: Regenerate.
1245 * test/pass[13..17]-frag.c: New testcases.
1246 * test/fail[13..17]-frag.c: New testcases.
1247
1248 2002-08-15 Graydon Hoare <graydon@redhat.com>
1249
1250 * mf-heuristics.c: New file.
1251 * mf-runtime.c (options): Add -trace-calls option.
1252 (__mf_init): Call __mf_init_heuristics.
1253
1254 2002-08-14 Graydon Hoare <graydon@redhat.com>
1255
1256 * Makefile.am (TESTS): Add testsuite support.
1257 * Makefile.in: Regenerate.
1258 * test/mf-driver.c: New file.
1259 * test/buildtest.sh: New file.
1260 * test/passNN-frag.c: New testcases.
1261 * test/failNN-frag.c: New testcases.
1262
1263 2002-08-14 Graydon Hoare <graydon@redhat.com>
1264
1265 * mf-hooks.c: Change __real_strlen() to __real_strlen()+1 when
1266 verifying non-size-limited string extents.
1267
1268 2002-08-14 Frank Ch. Eigler <fche@redhat.com>
1269
1270 * mf-hooks.c: Make __wrap string* functions use __real_str[n]len
1271 instead of plain str[n]len for internal checks.
1272 * mf-runtime.c (__mf_violation): Print optional stack traceback.
1273
1274 2002-08-14 Frank Ch. Eigler <fche@redhat.com>
1275
1276 * mf-hooks.c: Remove #if-0 around hooks that are now ld-wrapped.
1277
1278 2002-08-13 Graydon Hoare <graydon@redhat.com>
1279
1280 * mf-runtime.c: Rework configuration to operate on
1281 environment variable options rather than #defines
1282 (__mf_violation): Add simple fork-a-gdb violaiton mode.
1283 (__mf_init): Set static __mf_active_p flag on startup,
1284 to inhibit mudflap wrap-based checking during crt0.s.
1285 * mf-runtime.h: Declare options structure.
1286 * mf-hooks.c: New wrappings for mem*, b*, str*
1287 libc functions (temporarily #if 0-ed out).
1288
1289 2002-08-12 Frank Ch. Eigler <fche@redhat.com>
1290
1291 * Makefile.am, configure.in: New files.
1292 * Makefile.in, Makefile, configure, config.h.in: New generated files.
1293 * stamp-h.in, aclocal.m4: Ditto.
1294
1295 2002-08-08 Frank Ch. Eigler <fche@redhat.com>
1296
1297 * Makefile: New file.
1298 * mf-config.h: New file: runtime configuration.
1299 * mf-hooks.c: New file: interposed libc functions.
1300 * mf-runtime.c: New file: bulk of runtime.
1301 * mf-runtime.h: New file: public functions.