* arith.c: Fix comment typos.
[official-gcc.git] / libmudflap / ChangeLog
blobeafa5eb3e57a5f39e544f15227e48000ad7723b5
1 2004-03-25  Frank Ch. Eigler  <fche@redhat.com>
3         * mf-impl.h: Added libgcc license header.
5 2004-03-20  Frank Ch. Eigler  <fche@redhat.com>
7         * mf-hooks[123].c, mf-runtime.c, mf-heuristics.c:
8         Added libgcc license header.
9         * mf-hooks3.c (__mf_0fn_pthread_create): Correct arg constness.
10         (pthread_create): Simplify stack allocation syntax.
12 2004-03-08  Loren J. Rittle  <ljrittle@acm.org>
14         * mf-hooks2.c: Support FreeBSD.
15         (WRAP_gets): Avoid gets().
16         * testsuite/libmudflap.c/pass-stratcliff.c: Do not
17         test unimplemented mem/str calls on FreeBSD.
18         * testsuite/libmudflap.c/pass21-frag.c: Do not include
19         <alloca.h> on FreeBSD.
21 2004-01-30  Frank Ch. Eigler  <fche@redhat.com>
23         * testsuite/libmudflap.c/pass36-frag.c: Add missing free() call.
24         * testsuite/libmudflap.c/pass46-frag.c: New test for -fmudflapir.
25         * testsuite/libmudflap.cth/cthfrags.exp: Add -DSTATIC to compiler
26         flags for static linking permutation.
27         * testsuite/libmudflap.cth/pass40-frag.c: When -DSTATIC, avoid
28         some pthreads code that croaks on linux glibc tls.
30 2004-01-27  Frank Ch. Eigler  <fche@redhat.com>
32         * testsuite/libmudflap.c/fail31-frag.c, pass45-frag.c: New tests.
34 2004-01-15  Frank Ch. Eigler  <fche@redhat.com>
36         * testsuite/libmudflap.c/pass44-frag.c: New test.
38 2004-01-12  Frank Ch. Eigler  <fche@redhat.com>
40         * testsuite/libmudflap.c/fail{28,29,30}-frag.c: New tests.
42 2004-01-08  Frank Ch. Eigler  <fche@redhat.com>
44         * testsuite/libmudflap.c/pass43-frag.c: Added missing program rc.
46 2003-12-11  Frank Ch. Eigler  <fche@redhat.com>
48         * testsuite/libmudflap.c/pass42-frag.c, pass43-frag.c: New tests.
50 2003-12-08  Andrew Pinski  <pinskia@physics.uc.edu>
52         PR libmudflap/12670
53         * configure.in: Add check for see if
54         socklen_t typedef is in sys/socket.h.
55         * mf-hooks1.c: Add define if socklen_t
56         is not typedef.
57         * mf-hooks2.c: Likewise.
58         * mf-hooks3.c: Likewise.
59         * config.h.in: Regen.
60         * configure: Regen.
62 2003-12-08  Frank Ch. Eigler  <fche@redhat.com>
64         * mf-runtime.c (__mf_watch_or_not): Tweak tracing message.
65         * testsuite/libmudflap.c/fail21-frag.c: Defeat aliasing
66         optimizations.
67         * testsuite/libmudflap.c/pass25-frag.c: Ditto.
68         * testsuite/libmudflap.c/pass26-frag.c: Tolerate non-overlapping
69         (unoptimized) allocation of stack space.
71 2003-12-07  Richard Henderson  <rth@redhat.com>
73         * testsuite/libmudflap.c/fail23-frag.c (main): Adjust addend to 11.
74         * testsuite/libmudflap.c/fail27-frag.c (foo): Mark noinline.
76 2003-12-06  Andrew Pinski <apinski@apple.com>
78         partial PR libmudflap/12670
79         * mf-hooks1.c: Respect Darwin checks.  Conditionalize POSIX_SOURCE.
80         * mf-hooks2.c: Likewise.
81         * mf-hooks3.c: Likewise.
83 2003-11-19  Frank Ch. Eigler  <fche@redhat.com>
85         libstdc++/11696
86         * mf-runtime.h.in: Switch to #pragma redefine_extname for
87         symbols interposed at compile time.
88         * testsuite/libmudflap.c++/pass41-frag.cxx: New test.
90         libmudflap/12939
91         * mf-hooks2.c (semctl): Tolerate FreeBSD.
93         * configure.in: Reorganize check for <pthread.h>.
94         * configure: Regenerated.
95         
96 2003-11-04  David Edelsohn  <edelsohn@gnu.org>
98         * mf-runtime.c (_ALL_SOURCE): Define for AIX.
99         (_LARGE_FILE_API): Define for AIX.
100         * mf-hooks[123]: Same.
101         (_XOPEN_SOURCE_EXTENDED): Define to 1 for AIX.
103 2003-10-21  David Edelsohn  <edelsohn@gnu.org>
105         * mf-runtime.c (_XOPEN_SOURCE_EXTENDED): Define to 1 for AIX.
107 2003-07-29  Frank Ch. Eigler  <fche@redhat.com>
109         2003-07-29  Gerald Pfeifer  <pfeifer@dbai.tuwien.ac.at>
111         * configure.in: Update check for union semun.
113 2003-07-29  Gerald Pfeifer  <pfeifer@dbai.tuwien.ac.at>
115         PR other/11673
116         * mf-hooks2.c [WRAP_semctl]: Fix check for HAVE_UNION_SEMUN.
118 2003-07-29  Frank Ch. Eigler  <fche@redhat.com>
120         PR other/11673
121         * configure.in: Add checks for 64-bit LFS functions, struct semun
122         definition, for BSD compatibility.
123         * mf-hooks1.c: Respect BSD checks.  Conditionalize POSIX_SOURCE.
124         * mf-hooks2.c: Ditto.  Include <strings.h> for bcmp* decls.
125         * mf-hooks3.c: Ditto.
126         (pthread_create): Try MAP_ANON on platforms without the MAP_ANONYMOUS
127         mmap flag.
128         * configure, config.h.in: Regenerated.
130 2003-07-23  Frank Ch. Eigler  <fche@redhat.com>
132         Multithreading fixes:
133         * mf-runtime.c (__mf_object): Store allocating/deallocating
134         thread id.
135         (options): Support new "-thread-stack" option.
136         Rename "-heur-argv-environ" option to "-heur-stdlib".
137         Disable "-lc-mask" and "-lc-shift" options.
138         (__mf_dynamic): Add function pointers for pthread_join/_exit.
139         (__assert_fail): New self-contained function for glibc.
140         * mf-hooks3.c: Essentially rewritten, particularly related to
141         use of __mf_pthread_info array.
142         (pthread_join, _exit): New hook functions.
143         * mf-impl.h (BEGIN_PROTECT): Handle starting_p case.
144         * testsuite/libmudflap.cth/pass40-frag.c: New test.
146         Warning cleanups:
147         * mf-heuristics.c: Add type casts for tracing, sub calls.
148         * mf-impl.h (BEGIN_PROTECT): Redefine to omit result type.
149         Update all callers to declare explicit result holder.
150         (END_PROTECT): Removed.
151         * testsuite/*/*frags.exp: Clean up default MUDFLAP_OPTIONS.
153 2003-07-15  Diego Novillo  <dnovillo@redhat.com>
155         * testsuite/libmudflap.c/fail21-frag.c: Add volatile modifiers.
156         * testsuite/libmudflap.c/fail15-frag.c: Likewise.
157         * testsuite/libmudflap.c/fail13-frag.c: Likewise.
159 2003-07-04  Frank Ch. Eigler  <fche@redhat.com>
161         * mf-hooks1.c, 2.c, 3.c: New file, splits up content from old ...
162         * mf-hooks: Removed.
163         * mf-impl.h (MF_VALIDATE_EXTENT, BEGIN_PROTECT, END_PROTECT):
164         Move these macros from old mf-hooks.c here.
165         * Makefile.am: Adapt to split-up hook sources for faster builds.
166         * Makefile.in: Regenerated.
168         * mf-heuristics.c: Remove #if-0 block.
170         * mf-impl.h (__mf_state): Reorganize declaration and implementation.
171         (__mf_starting_p): New state only for use while dlsym bootstrapping.
172         (CALL_REAL, __mf_init): Corresponding changes.
173         (TRACE, VERBOSE_TRACE): Include thread id and "mf:" prefix.  Update
174         all callers to remove redundant "mf:" prefix.
175         * mf-runtime.h.in: #define a few reentrancy macros for libmudflapth.
176         * mf-hooks3.c: Rewrite chunks to support per-thread __mf_state value.
177         (__mf_pthread_info): Become a hash table.
179         * testsuite/lib/mfdg.exp: Support new "dg-timeout" and
180         "dg-repetitions" directives to control test case execution.
181         * testsuite/libmudflap.cth/pass37-frag.c: Add timeout and repeat
182         options.
183         * testsuite/libmudflap.cth/pass39-frag.c: Ditto for this new test.
185 2003-06-25  Frank Ch. Eigler  <fche@redhat.com>
187         * mf-hooks.c (alloca): Separate into stub.
188         (__mf_wrap_alloca_indirect): New function.  Use CALL_REAL
189         malloc/free for alloca blocks.
190         (pthread_create): Tolerate failing pthread_attr_get* calls.
191         * mf-runtime.c (__mf_fini): Call __mf_wrap_alloca_indirect.
192         * mf-impl.h (CALL_WRAP): Remove macro.
193         * testsuite/libmudflap.c/pass21-frag.c: Include <alloca.h>.
194         * testsuite/libmudflap.c/pass23-frag.c: Include more struct
195         padding for ia64 BIT_FIELD_REF constructs.
197 2003-06-19  Frank Ch. Eigler  <fche@redhat.com>
199         * mf-hooks.c (struct pthread_info): Add "thread_errno" field.
200         (__mf_pthread_spawner, __mf_pthread_cleanup): Use it with GUESS 
201         libmudflap object type.
202         * mf-runtime.c (__mfu_unregister): Correct cemetary logic to avoid
203         crashes on unregistering STATIC objects.
205 2003-06-17  Frank Ch. Eigler  <fche@redhat.com>
207         Based on patch from Eyal Lebedinsky <eyal@eyal.emu.id.au>:
208         * mf-hooks.c (__mf_pthread_spawner): Register thread errno.
209         (time, strerror, fopen, fopen64, fclose, fread): New hooks.
210         (fwrite, fgetc, fgets, getc, gets, ungetc, fputc): New hooks.
211         (fputs, putc, puts, clearerr, feof, ferror, fileno): New hooks.
212         (printf, fprintf, sprintf, snprintf, vprintf, vfprintf): New hooks.
213         (vsprintf, vsnprintf, access, remove, fflush, fseek): New hooks.
214         (fseeko64, ftell, ftello64, rewind, fgetpos, fsetpos): New hooks.
215         (stat, stat64, fstat, lstat, mkfifo, setvbuf, setbuf): New hooks.
216         (setvbuf, opendir, closedir, readdir, recv, recvfrom): New hooks.
217         (recvmsg, send, sendto, sendmsg, setsockopt, getsockopt): New hooks.
218         (accept, bind, connect, gethostname, sethostname): New hooks.
219         (gethostbyname, wait, waitpid, popen, pclose, execve): New hooks.
220         (execv, execvp, system, dlopen, dlclose, dlerror, dlsym): New hooks.
221         (semop, semctl, shmctl, shmat, shmdt): New hooks.
222         * mf-runtime.h.in: Corresponding changes.
223         * mf-runtime.c (__mf_ini): Register stdio objects.  Use STATIC type.
224         (opts) Rename heur_argv_environ to heur_std_data.
225         (__mf_wrap_main): Use STATIC type for argv/environ strings.
226         * Makefile.am: Corresponding changes.
227         * Makefile.in: Regenerated.
229 2003-06-11  Frank Ch. Eigler  <fche@redhat.com>
231         * mf-heuristics.c (__mf_heuristic_check): Disable stack_bounds 
232         heuristic for threaded case, and for non-x86-linux targets.
233         * mf-hooks.c (__mf_0fn_calloc): Provide a working dummy implementation
234         for use during pre-main() program startup.
235         (__mf_0fn_*): Make these functions non-static.
236         * mf-impl.h (DECLARE, CALL_REAL): Support calls to 0fn backup hook 
237         functions.
238         * mf-runtime.c (__mf_state): Set initial state to "starting".
239         (__mf_resolve_single_dynamic): Tolerate repeated calls for same symbol.
240         (__wrap_main): New function to register argv[] and environ[] strings.
241         (__mf_ini): Call it.
242         (*): In all trace functions, use "%p" as formatter for uintptr_t.
244         * testsuite/libmudflap.c/pass38-frag.c: New test case.
245         * testsuite/libmudflap.cth/pass37-frag.c: Improved test.
246         
247         * acinclude.m4: Add comments with aoliva's concerns about x86_64 
248         pass_all.
249         * aclocal.m4, configure: Regenerated.
251 2003-06-04  Frank Ch. Eigler  <fche@redhat.com>
253         * acinclude.m4: Correct typo in AC_MSG_CHECKING.
254         * aclocal.m4, configure: Regenerated.
256 2003-06-03  Frank Ch. Eigler  <fche@redhat.com>
258         * acinclude.m4: Force "pass_all" deplibs_check_method for libtool
259         for x86_64 target.  Disable caching for this value.
260         * aclocal.m4, configure: Regenerated.
262 2003-06-02  Frank Ch. Eigler  <fche@redhat.com>
264         * testsuite/libmudflap.c/pass38-frag.c: Deleted.  -fwritable-strings
265         is about to become deprecated, and its present handling bugs are
266         unworthy of fixing.
268 2003-05-30  Frank Ch. Eigler  <fche@redhat.com>
270         * testsuite/libmudflap.c/pass38-frag.c: New test for
271         -fwritable-strings.
273 2003-05-23  Frank Ch. Eigler  <fche@redhat.com>
275         * mf-runtime.c (__mf_sigusr1_handle): Call unlocked variant of
276         __mf_report, asserting reentrant calling context.
278 2003-05-23  Frank Ch. Eigler  <fche@redhat.com>
280         * mf-hooks.c (realloc): Correct reentrancy logic.
281         * testsuite/libmudflap.c/hook-allocstuff.c: New test case.
283 2003-05-20  Frank Ch. Eigler  <fche@redhat.com>
285         * mf-hooks.c (LIBMUDFLAPTH_THREADS_MAX): New macro, replaces
286         PTHREAD_THREADS_MAX.  Update users.
287         * mf-runtime.c (__mf_usage): Print [active] instead of [default]
288         for active options.
289         * testsuite/Makefile.am (all-local): Prime dejagnu site.exp file
290         with libmudflapth presence indicator.
291         * testsuite/Makefile.in: Regenerated.
293 2003-05-16  Frank Ch. Eigler  <fche@redhat.com>
295         * Makefile.am (AM_CFLAGS): Remove "-ansi".
296         * configure.in: Remove silly no-pthreads => no-shared logic.
297         * Makefile.in, configure: Regenerated.
298         * mf-heuristics.c (__mf_heuristic_check): Remove reentrancy hacks.
299         * mf-hooks.c (BEGIN_PROTECT, END_PROTECT): Reorganize reentrancy
300         code.  Count reentrancy events.
301         (all hook functions): Don't directly manipulate __mf_state variable.
302         Add TRACE calls to hook functions without them.
303         * mf-impl.h (LOCKTH): Try to count lock contention events.
304         (VERBOSE_TRACE, TRACE): Remove reentrancy hacks.
305         * mf-runtime.c (BEGIN_RECURSION_PROTECT, END_RECURSION_PROTECT):
306         Reorganize reentrancy code.
307         (external __mf_ entry points): Use RECURSION_PROTECT mechanism to
308         identify reentrancy with mutex holding times.
309         (internal __mfu_ entry points): Remove internal reentrancy code.
310         (__mf_init): Use ordinary locked calls.
311         (__mfu_report): Print the two new counts.
312         * testsuite/lib/libmudflap.exp: Filter out junk ld/pthreads messages.
313         * testsuite/libmudfap.cth/cthfrags.exp: New test driver.
314         * testsuite/libmudflap.cth/pass37-frag.c: New pthreads test. 
315         * testsuite/libmudfap.cth/cfrags.exp: Adapt to new libmudflap
316         option defaults.
318 2003-05-09  Frank Ch. Eigler  <fche@redhat.com>
320         * configure.in: Add pthread support, plus glibc and porting hacks.
321         * Makefile.am (LIBMUDFLAPTH): New conditional, to build -lmudflapth
322         from objects built into ./pth/.
323         * mf-runtime.c (__mfu_watch,register,...): Fork new unlocked
324         functions for internal entry points.  Update callers to pick
325         locked vs. unlocked variants.
326         (__mf_resolve_single_dynamic): Extend to support symbol versioning
327         info coming in from a static data structure.
328         (*): Reorder miscellaneous declarations to group data vs functions.
329         (__mf_set_default_options): Simplify.
330         (__mf_usage): Mention threading status of host executable.
331         * mf-impl.h: Move max/min decls here.  Reorganize __mf_dynamic
332         decls to match above.
333         (LOCKTH, UNLOCKTH): New macros for Big Libmudflap Lock management.
334         * mf-heuristics.c: Choose between locked/unlocked calls.  Add
335         some lock/unlock markers.  Remove some unused code.
336         * mf-hooks: Ditto.
337         (pthread_create): New hook function.
338         (__mf_pthread_cleanup, _spawner): New helper functions.
339         * configure. aclocal.m4, config.h.in, Makefile.in: Regenerated.
341 2003-05-02  Frank Ch. Eigler  <fche@redhat.com>
343         * testsuite/libmudflap.c/fail27-frag.c: Add more volatile flags.
345 2002-04-28  Frank Ch. Eigler  <fche@redhat.com>
347         * Makefile.am (HOOKOBJS): Add *time related hooks.
348         * configure.in: Look for pthreads.h header.
349         * mf-hooks.c (asctime, ctime, gmtime, localtime): New wrappers.
350         * mf-runtime.c: Begin sketching some pthreads support.
351         (__mf_usage): Check for -lpthread presence.
352         (__mf_unregister): Confirm matching unregistration base.
353         (__mf_find_objects_rec): Reduce unnecessary recursion.
354         * mf-runtime.h.in: Add "nothrow" attribute to functions.  Add 
355         #defines for new hook functions.
356         * mf-impl.h: Corresponding changes.
357         * config.h.in, configure, Makefile.in: Regenerated.
359 2002-04-27  Diego Novillo  <dnovillo@redhat.com>
361         * testsuite/libmudflap.c/fail1-frag.c: Add volatile
362         modifiers to prevent being optimized away.
363         * testsuite/libmudflap.c/fail10-frag.c: Likewise.
364         * testsuite/libmudflap.c/fail13-frag.c: Likewise.
365         * testsuite/libmudflap.c/fail14-frag.c: Likewise.
366         * testsuite/libmudflap.c/fail15-frag.c: Likewise.
367         * testsuite/libmudflap.c/fail2-frag.c: Likewise.
368         * testsuite/libmudflap.c/fail20-frag.c: Likewise.
369         * testsuite/libmudflap.c/fail3-frag.c: Likewise.
371 2003-04-15  Frank Ch. Eigler  <fche@redhat.com>
373         * Makefile.am (libmudflap_la_LIBADD): Remove -ldl.
374         * configure.in: Look for uintptr_t and -ldl on target.
375         * mf-runtime.h.in: Adjust uintptr_t declaration logic.
376         * Makefile.in, aclocal.m4, configure, config.h.in: Regenerated.
377         * testsuite/Makefile.in: Regenerated.
378         * mf-runtime.c (__mf_sigusr1_respond): Tweak declaration and calls
379         for better C compliance.
381 2003-04-15  Frank Ch. Eigler  <fche@redhat.com>
383         * mf-hooks.c (MF_VALIDATE_EXTENT): Remove unnecessary reentrancy
384         prevention code.
385         * mf-runtime.c (__mf_set_default_options): Turn off
386         check-initialization.
387         (__mf_describe_object): Shorten description.
388         * testsuite/libmudflap.c/fail25-frag.c: Turn on check-initialization.
390 2003-04-07  Frank Ch. Eigler  <fche@redhat.com>
392         * mf-hooks.c (__mf_0fn_mmap): Correct return value, as per <rth>.
394 2003-04-02  Frank Ch. Eigler  <fche@redhat.com>
396         * mf-hooks.c (BEGIN_PROTECT): Handle startup-time reentrant
397         calls specially.
398         (__mf_0fn_malloc ... _munmap): New dummy backup calls.
399         * mf-impl.h (CALL_BACKUP): New macros.
400         * mf-runtime.c (__mf_init): Tweak __mf_state during startup.
402 2003-03-31  Frank Ch. Eigler  <fche@redhat.com>
404         * Makefile.am (AM_CFLAGS): Remove optimization flags.
405         (HOOKOBJS): Remove dlopen hook.
406         (libmudflap_la_LIBADD): Add -ldl.
407         * mf-hooks.c (dlopen): Remove hook.
408         * mf-impl.h (__mf_dynamic): Ditto.
409         * mf-runtime.c (__mf_resolve_dynamics): Ditto.
410         * Makefile.in: Regenerated.
412 2003-03-28  Frank Ch. Eigler  <fche@redhat.com>
414         * configure.in: Check for target gettimeofday, signal, some headers.
415         * mf-impl.h (__mf_opts): Add new "sigusr1_report" field.  Comment
416         out inop multi_threaded field.
417         * mf-runtime.c (options): Handle new "-sigusr1-report" option.
418         (__mf_set_options): Correct handling of "-help".
419         (__mf_sigusr1_respond): New function to manage SIGUSR1 response.
420         (__mf_check, __mf_register, __mf_unregister): Call it.
421         (__mf_insert_new_object, __mf_unregister): Respect HAVE_GETTIMEOFDAY.
422         (__mf_report_leaks): Make callable
423         (__mf_tree_analyze): Traverse in-order.  Accumulate address bit
424         distribution statistics.
425         (__mf_adapt_cache): Rewrite shift guessing logic based on address
426         bit distributions.
427         * config.h.in, configure: Regenerated.
428         * testsuite/libmudflap.c/fail27-frag.c: New test.
429         * testsuite/libmudflap.c/pass36-frag.c: New test.
431 2003-03-11  Frank Ch. Eigler  <fche@redhat.com>
433         * mf-runtime.h.in: Tweak.
434         * Makefile.am, configure.in: Tweak mf-runtime.h generation some more.
435         Don't use intermediate files nor AC_OUTPUT-time postprocessing.
436         * Makefile.in, testsuite/Makefile.in, configure: Regenerated.
438 2003-03-10  Frank Ch. Eigler  <fche@redhat.com>
440         * configure.in: Tweak generation of mf-runtime.h some more.  It
441         needs to work from both config.status and configure.
442         * configure: Regenerated.
444 2003-03-10  Frank Ch. Eigler  <fche@redhat.com>
446         * Makefile.am: Reorganize hook file building.  Add auto dependencies.
447         * configure.in: Tweak generation of mf-runtime.h.
448         * mf-runtime.h.in: Add new __MF_TYPE_HEAP_I.
449         * mf-hooks.c (*): Adapt to initialized-heap object type.
450         * mf-impl.h: Tweak cemetary boundaries.
451         * mf-runtime.c (__mf_check): Adapt to new initialized-heap object
452         type.
453         (__mf_insert_new_object, __mf_register, __mf_unregister): Ditto.
454         (__mf_describe_object, __mf_report_leaks, __mf_violation): Ditto.
455         * testsuite/lib/libmudflap.exp (includes): Include build tree.
456         * testsuite/libmudflap.c/pass{26,5}: Further adapt to initialization
457         checking.
458         * testsuite/.../fail{25,26}-frag.c: New tests.
459         * testsuite/.../pass{32,33,34,35}-frag.c: New tests.
460         * Makefile.in, configure: Regenerated.
462 2003-03-05  Frank Ch. Eigler  <fche@redhat.com>
464         * mf-runtime.c (__mf_set_default_options): Turn on initialization
465         checking by default.
466         (__mf_insert_new_object): As a temporary hack, assume that new
467         objects registered on the stack start out initialized.
468         * testsuite/libmudflap.c/fail9,pass23,pass[6789]-*: Initialize
469         heap objects by hand.
471 2003-03-05  Frank Ch. Eigler  <fche@redhat.com>
473         Switch to macro-style hooks for str*/mem*/b* functions.
474         * mf-runtime.h.in (__MF_TYPE_*): Moved some internal values out.
475         (mem*, str*, b*): Added macro-style hooks for _MUDFLAP case.
476         * mf-runtime.c: #include config.h to enable glibc backtraces again.
477         (__mf_set_default_options): Turn off heur_proc_map.
478         (*): Adapt to to macro-style hook functions.
479         (__mf_object_dead_head, __mf_object_cemetary): Correct bounds.
480         (__mf_check, __mf_register, __mf_unregister): Tweak tracing message.
481         (__mf_violation): Handle __MF_VIOL_WATCH.
482         * mf-impl.h (__MF_TYPE_*): Moved these internal values here.
483         (__mf_dynamic): Removed mem*/str*/b* functions.
484         (TRACE, VERBOSE_TRACE): Add reentrancy locking.
485         (WRAPPER2): New macro for macro-style hooks.
486         * mf-hooks.c: Convert mem*/str*/b* functions to simpler
487         macro-style hooks.
488         (BEGIN_PROTECT): Tweak tracing vs reentrancy-lock ordering.
489         * mf-heuristics.c: Adapt to macro-style hook functions.
490         Correct some comments.
491         * testsuite/lib/mfdg.exp (dg-test): Simplify result string for
492         output pattern tests.
493         * testsuite/libmudflap.c/fail[89]-frag.c: Elaborate output test.
494         * testsuite/libmudflap.c++/c++frags.exp: Enable non-static tests.
496 2003-02-28  Frank Ch. Eigler  <fche@redhat.com>
498         * testsuite/libmudflap.c/fail23-frag.c, pass30-frag.c: New tests
499         for global array registration.
500         * testsuite/libmudflap.c++/fail24-frag.cxx, pass31-frag.cxx: Ditto.
501         * testsuite/libmudflap.c++/c++frags.exp: Tweak -static multilib hack.
503 2003-02-27  Frank Ch. Eigler  <fche@redhat.com>
505         * Makefile.am: Add gross make bug workarounds.  Tweaked
506         SUBDIRS and AM_CFLAGS.
507         * Makefile.in: Regenerated.
509 2003-02-26  Frank Ch. Eigler  <fche@redhat.com>
511         Switch to dejagnu.
512         * configure.in (AC_PROG_CXX): Don't look for C++ any more.
513         * Makefile.am (TESTS): Remove simple automake testing.
514         * configure, Makefile.in: Regenerated.
515         (SUBDIRS): Include new testsuite/ directory.
516         * tests/*: Removed all files; moved bulk under:
517         * testsuite/*: New subdirectory tree.
518         * testsuite/libmudflap.c/cfrags.exp: New file, C test driver.
519         * testsuite/libmudflap.c++/c++frags.exp: New file, C++ test driver.
520         * testsuite/lib/libmudflap.exp: New file, derived from libstdc++.
521         * testsuite/lib/mfdg.exp: New file, derived from dejagnu.
522         * testsuite/config/default.exp: New file.
523         * testsuite/Makefile.am, Makefile.in: New files.
525 2003-01-29  Frank Ch. Eigler  <fche@redhat.com>
527         * Makefile.am (TESTS_ENVIRONMENT): Remove redundant "-mode-check".
528         (TESTS): Add fail22 and pass29 tests.
529         * mf-runtime.h.in: Change API to take void*/size_t region parameters.
530         Add new access-type parameter for __mf_check.  Move __MF_VIOL* out.
531         * mf-impl.h: Corresponding changes.  Update CLAMP* macros for void*
532         values.  Move __MF_VIOL* here.
533         * mf-runtime.c (*): Adapt to void*/size_t API in mf-runtime.h.
534         (check_initialization): New field in __mf_opts.  Default off.
535         (read_count,write_count): New fields in __mf_object.
536         (__mf_check): Implement basic initialization checking.
537         (__mf_insert_new_object): Assume STATIC|GUESS regions are initialized.
538         (__mf_describe_object): Print new fields.
539         (__mf_violation): Identify check/read vs. check/write in messages.
540         * test/pass29-frag.c, test/fail22-frag.c: Basic tests for new
541         "-check-initialized" mudflap option.
542         * test/pass25-frag.c, test/fail21-frag.c: Adapt to API changes.
543         * mf-hooks.c (MF_VALIDATE_EXTENT): Add new access-type parameter.
544         Drop __FILE__/__LINE__ hack.  Update callers.
545         (*): Adapt to new mf-runtime.h API.
546         * Makefile.in: regenerated.
548 2003-01-24  Frank Ch. Eigler  <fche@redhat.com>
550         * configure.in: Build mf-runtime.h a more proper way.
551         * mf-hooks.c (strdup, strndup): Correct reentrancy logic.
552         * mf-runtime.c (verbose_violations): Turn on by default.
553         * mf-runtime.h.in: Remove some miscellaneous stuff ...
554         * mf-impl.h: ... and move it here.
555         * configure: Regenerated.
557 2003-01-22  Frank Ch. Eigler  <fche@redhat.com>
559         * configure.in: Look for C++ compiler.
560         * test/*-frag.c, mf-driver.c: Reformatted with GNU indent and
561         fixed type warnings when built with C++.
562         * test/pass27-frag.cxx, pass28-frag.cxx: New C++ tests.
563         * Makefile.am (TESTS): Run them.
564         (*) Add new rules for building and running C++ tests.
565         (TESTFLAGS): Set new default to avoid libstdc++-v3 shlib issues.
566         * mf-runtime.h.in: Protect with extern "C".
567         * Makefile, configure: Regenerated.
569 2003-01-06  Frank Ch. Eigler  <fche@redhat.com>
571         Portability improvements.
572         * configure.in: Look for glibc backtrace headers/functions.
573         * mf-hooks.c: Don't include <execinfo.h> any more.
574         * mf-runtime.c (__mf_set_options): Call more stdlib functions
575         via CALL_REAL.
576         (__mf_backtrace): Provide alternate baby implementation in 
577         absence of glibc.
578         * test/mf-driver.c: Portability tweaks.
579         * acinclude.m4: New file, containing top level libtool.m4.
580         * aclocal.m4, configure, Makefile.in, config.h.in: Regenerated.
582 2002-12-19  Frank Ch. Eigler  <fche@redhat.com>
584         * mf-runtime.h.in (HAVE_UINTPTR_T): Define unconditionally.
586 2002-11-08  Frank Ch. Eigler  <fche@redhat.com>
587         
588         * mf-runtime.c (options): Add new "wipe-heap", "wipe-stack"
589         options.
590         (__mf_unregister): Implement stack/heap object wiping.
591         (__mf_set_options): Renamed from __mf_process_opts.
592         (__mf_uncache_object): Change arg type, correct callers. 
593         * mf-impl.h: Corresponding changes.
594         * mf-hooks.c (realloc): Save/restore heap-wiping flag.
595         * mf-runtime.h.in (__mf_set_options): Extend public API.
596         * test/pass26-frag.c: New test for stack wiping.
597         * Makefile.am (TESTS): Run it.
598         * Makefile.in: Regenerated.
599         
600 2002-11-07  Frank Ch. Eigler  <fche@redhat.com>
602         * mf-runtime.h.in (__mf_watch, __mf_unwatch): Extend public API.
603         * mf-runtime.c (__mf_object_t): Add watching_p field.
604         (__mf_watch_or_not): New function to implement
605         object watch flagging.
606         (__mf_watch, __mf_unwatch): New wrappers for above.
607         (__mf_check, __mf_describe_object): Handle objects with watching_p.
608         (__mf_count_violation): Enlarge array.
609         (__mf_uncache_object): Renamed from __mf_remove_old_object.  Don't
610         unlink object.  Clear cache properly.
611         (__mf_unregister): Unlink object explicitly before uncaching.
612         * test/fail21-frag.c, pass25-frag.c: New tests.
613         * Makefile.in, aclocal.m4: Regenerated.
614         
615 2002-11-05  Frank Ch. Eigler  <fche@redhat.com>
617         * test/fail20-frag.c: New test for NULL pointer dereferencing.
618         * Makefile.am (TESTS): Add it.
619         * test/pass-stratcliff.c: Add decls of stpcpy.
620         * configure.in: Test for <stdint.h>.  Generate mf-runtime.h in
621         build tree from config.h and new file mf-runtime.h.in.
622         * mf-runtime.h.in: Renamed from mf-runtime.h.  Tweak uintptr_t decl.
623         * Makefile.in, configure, config.h.in: Regenerated.
624         * mf-hooks.c: Add #undef for wrapped glibc str*/mem* macros.    
625         * mf-runtime.c (options, __mf_set_default_options): Support new 
626         default "abbreviate" option.
627         (__mf_object.description_epoch): New field.
628         (__mf_describe_object): Conditionally abbreviate objects already
629         displayed in current epoch.  Accept NULL input to increment epoch.
630         (__mf_fini, __mf_ini): Reset description epoch.
631         (__mf_register, __mf_unregister, __mf_adapt_cache, __mf_init): Ensure
632         that NULL pointer slot in lookup cache is invalidated.  Register a
633         NOACCESS region around NULL.
634         * mf-impl.h: Corresponding changes.
636 2002-10-16  Frank Ch. Eigler  <fche@redhat.com>
638         * test/fail19-frag.c, pass24-frag.c, pass-stratcliff.c: New tests.
639         * Makefile.am: Run them.  Install mf-runtime.h.
640         * Makefile.in: Regenerated.
641         * mf-hooks.c: Add some markers for more missing functions.
642         * mf-runtime.c (__mf_adapt_cache): Experiment with a utilization-based
643         statistic to tune tune cache size (mask).
645 2002-10-01  Frank Ch. Eigler  <fche@redhat.com>
647         * test/pass23-frag.c: New test for bit_field_ref expressions.
648         * Makefile.am, Makefile.in: Add new test.
649         * mf-hooks.c (mmap, munmap): Rewrite to track individual pages.
650         (MF_VALIDATE_EXTENT): Accept zero-size mem/str operations.
651         * mf-runtime.c (__mf_init): Register errno global.
652         (__mf_find_object): Removed function.
653         (__mf_check): Rewrite logic to support accesses across some
654         contiguous but distinctly registered objects.
655         (__mf_remove_old_object): Tolerate cache entries that span
656         contiguous objects.
658 2002-09-30  Frank Ch. Eigler  <fche@redhat.com>
660         * test/pass21-frag.c, pass22-frag.c: New tests: alloca, bitfields.
661         * Makefile.am, Makefile.in: Run new tests.
662         * mf-hooks.c (alloca): Correct stack direction logic.
664 2002-09-26  Frank Ch. Eigler  <fche@redhat.com>
666         * mf-impl.h (adapt_cache): New option.
667         * mf-runtime.c (__mf_set_default_options): Set its default value.
668         Tweak the tree_aging parameter down.
669         (__mf_check): Maintain separate counter for cache-adaptation.
670         (__mf_tree_analyze): New function to collect object tree stats.
671         (__mf_adapt_cache): New function to automate cache parameters.
673 2002-09-24  Frank Ch. Eigler  <fche@redhat.com>
675         * mf-heuristics.c (__init_misc, __mf_heuristic_check): Add
676         hypothetical #if-0'd argv/envp region registration.
677         * mf-runtime.c (__mf_init): Add kludged form of above.
678         (*) Add "heur_argv_environ" flag, default on, to govern this.
679         * mf-impl.h: Corresponding changes.
681 2002-09-20  Frank Ch. Eigler  <fche@redhat.com>
683         * test/fail18-frag.c: New test file for NOACCESS regions.
684         * Makefile.am (TESTS): Add new test.
685         * Makefile.in: Regenerated.
687         * mf-heuristics.c (__mf_heuristics_check): Correct deja_vu logic.
688         * mf-impl.h (tree_aging): Add new mudflap_option, default 1000000.
689         (optimize_object_tree): Remove unused mudflap_option.
690         * mf-runtime.h (__MF_TYPE_NOACCESS): New region type.  Add printing
691         support throughout.  Use .._MAX_CEM for cemetary upper bound.
692         * mf-runtime.c (__mf_init): Register __mf_* globals as NOACCESS
693         regions.
694         (__mf_object): Add new liveness field for use by tree aging.
695         (__mf_check): Trigger tree aging when needed.
696         (__mf_age_tree): New function to decay liveness field.
697         (__mf_find_objects_rec): Use liveness field to rotate tree.
698         (__mf_insert_new_object): Only provide backtrace for HEAP objects.
699         (__mf_unregister): Ditto.
700         (__mf_register): Tweak duplicate-static message.
701         (__mf_violation: Tweak nearby-object counter printing.
703 2002-09-16  Frank Ch. Eigler  <fche@redhat.com>
705         * test/pass20-frag.c: New test file.
706         * Makefile.am (TESTS): Reorganize.  Add pass20 test.
707         * Makefile.in: Regenerated.
709         * mf-impl.h (TRACE_IN, TRACE_OUT): Remove macros.  Update callers.
710         * mf-hooks.c (BEGIN_PROTECT): Add hook tracing here.
711         * mf-heuristic.c (__mf_heuristic_check): Track seen /proc/self/map
712         entries to avoid repeat registration.
713         * mf-runtime.c (__mf_object_cemetary): Don't bother bury GUESS regions.
714         (__mf_register, __mf_unregister): Rewrite GUESS handling logic.
715         
716 2002-09-09  Frank Ch. Eigler  <fche@redhat.com>
718         * Makefile.am: Create test sources with #include, not cat>>.
719         * Makefile.in: Regenerated.
720         * test/buildtest.sh: Removed.
721         * test/driver.c (abort_handler, main): Be quiet.
723 2002-09-06  Frank Ch. Eigler  <fche@redhat.com>
725         * test/pass18-frag.c, pass19-frag.c: New tests.
726         * Makefile.am (check): Run them.  Rebuild test programs each time.
727         * Makefile.in: Regenerated.
729 2002-09-06  Frank Ch. Eigler  <fche@redhat.com>
731         * mf-runtime.c (__mf_register): Correct SEGV-inducing error in
732         overlapping object search.
733         (__mf_violation): Likewise for nearby objects.
734         Improve nearby-object listing.
735         
736         cleanup:
737         * mf-runtime.c, mf-hooks.c: Remove "{{{"/"}}}" folding marks.
738         * mf-heuristics.c (__mf_heuristic_check): Tweak message.
740 2002-09-03  Frank Ch. Eigler  <fche@redhat.com>
742         alloca support:
743         * Makefile.am (AM_CFLAGS): New definition of needed settings.
744         (HOOKOBJS): Add alloca-hook.o.
745         * mf-hooks.c (alloca): New function to implement alloca in libiberty
746         style.
747         * mf-runtime.c (__mf_report): Call alloca(0) to flush remaining blocks.
748         (__mf_backtrace): Reimplement without using alloca.
749         * Makefile.in: Regenerated.
751         cleanup:
752         * mf-hooks.c: Use VERBOSE_TRACE throughout instead of fprintf(stderr).
753         Correct signedness bugs in length-tracking variables.
754         * mf-impl.h: Make options unsigned.
755         (CALL_WRAP): New macro to parallel CALL_REAL().
756         (DECLARE): Remove erroneous ";" at end.
757         * mf-runtime.c, mf-hooks.c, mf-heuristics.c: Replace remaining %p
758         formatting specs with %08lx.  Correct several compiler warnings.
760 2002-08-28  Frank Ch. Eigler  <fche@redhat.com>
762         * mf-runtime.c (__mf_violation): Try harder to locate nearby objects.
764 2002-08-27  Frank Ch. Eigler  <fche@redhat.com>
766         libmudflap hook breakup:
767         * Makefile.am (TESTS_ENVIRONMENT): Add ../../gcc to LD_LIBRARY_PATH
768         for libgcc_s.
769         (TESTS): Make dependent on libmudflap.
770         (HOOKOBJS): Break up mf-hooks.o into many little hook objects,
771         compiled from segments of mf-hooks.c.
772         * mf-hooks.c: Corresponding changes: wrap each function in
773         #ifdef/#endif.
774         * Makefile.in: Regenerated.
776         Heuristics reorganization:
777         * mf-heuristics.c (__mf_register_ro_sections, __mf_init_heuristics): 
778         Remove these functions.  Update callers.
779         (__mf_heuristic_check): Incorporate all the various heuristics.
780         Encode cacheability/retry judgement into trinary return value.
781         Separate start-end logic into a separate fallback heuristic.  Only
782         register relevant /proc/self/map segments.
783         * mf-impl.h: Corresponding changes.
784         * mf-runtime.c (__mf_check): Reorganize heuristics fallback logic.
785         (__mf_init): Don't call __mf_init_heuristics.
787         Tracing cleanup:
788         * mf-heuristics.c, mf-runtime.c: Use new MUDFLAP_OPTION
789         "-verbose-trace" to emit all tracing messages other than those of
790         basic public api.  Eliminate some duplicate/excessive messages.
791         * mf-runtime.h: Corresponding changes.
793 2002-08-27  Graydon Hoare  <graydon@redhat.com>
795         * mf-impl.h (WRAPPER): Change to create linker aliases for __wrap
796         and __real when compiled with -DPIC.
797         * mf-hooks.c (WRAPPER): Change all uses of WRAPPER macro slightly.
798         * Makefile.am (AUTOMAKE_OPTIONS): Fix LD_LIBRARY_PATH for tests.
799         * Makefile.in: Regenerate.
801 2002-08-26  Graydon Hoare  <graydon@redhat.com>
803         * mf-impl.h: New file, private implementation header.
804         * mf-runtime.h: Reorganize a bit.
805         (CLAMPSZ): Fix arithmetic.
806         (__MF_CACHE_MISS_P): Fix arithmetic.
807         * mf-runtime.c: Reorganize a bit.
808         (__mf_dynamic): New structure.
809         (resolve_single_dynamic): New function.
810         (__mf_resolve_dynamics): New function.
811         (__mf_init): Initialize dynamic wrappers.
812         * mf-hooks.c: Macro-ize __real calls.
813         Clamp various bits of arithmetic.
814         Add explicit __mf_check call contexts.
815         * Makefile.am: Add dependencies on mf-impl.h
816         * Makefile.in: Regenerate.
817         * configure.in: Comment out shared override.
818         * configure: Regenerate.
820 2002-08-22  Graydon Hoare  <graydon@redhat.com>
822         * mf-runtime.c (__mf_process_opts): Sanity-check free_queue_length.
823         (__mf_check): Re-inialize and check heuristics before violation.
824         (__mf_register): Permit updating pure-guess regions.
825         * mf-hooks.c (__wrap_free): Correct some free queue logic.
826         (__wrap_dlopen): New wrapper function.
827         (__wrap_mmap): New wrapper function.
828         (__wrap_munmap): New wrapper function.
829         * mf-heuristics.c (__mf_register_ro_sections): Register *all* regions
830         which are not stack addresses.
831         (is_stack_address): New function.
832         (__mf_init_heuristics): Save and restore state, always initialize with
833         "starting" state.
835 2002-08-21  Frank Ch. Eigler  <fche@redhat.com>
837         * mf-hooks.c (MF_VALIDATE_EXTENT): Rewrite to correct off-by-one
838         error.  Pass location string.
839         (wrap_strcpy, wrap_strncpy): Remove extra %s in trace strings.
840         * mf-runtime.c (options): Add lc-mask, lc-shift options.
841         (__mf_process_opts): Apply some sanity checking for lc-mask.
842         (__mf_check, __mf_violation): Take new location-string argument.
843         Update callers to pass NULL if necessary.
844         (__mf_backtrace): New smart backtracer function.  Calls replace
845         several ad-hoc blocks elsewhere.
846         (__mf_describe_object): Remove bad reentrancy test.  Improve
847         tracing message.
848         * mf-runtime.h: Corresponding changes.  Public/private markup.
849         (__MF_CACHE_MISS_P): New macro.
851 2002-08-20  Graydon Hoare  <graydon@redhat.com>
853         * mf-runtime.h: New option: stack_bound (heuristic). 
854         Move some macros out of implementation files.
855         * mf-runtime.c: New option string: -stack-bound.
856         Unify recursion protection with hooks. 
857         Add more logging.
858         (__mf_check): Call __mf_heuristic_check.
859         (__mf_process_opts): Fix "no-" processing.
860         * mf-heuristics.c (__mf_heuristic_check): New function.
861         * mf-hooks.c: Much off-by-one fixing, recursion protection.
863 2002-08-20  Frank Ch. Eigler  <fche@redhat.com>
865         Option parsing improvements, region splitting bug fixes:
866         * mf-heuristics.c (__mf_register_ro_sections): Add warned casts.
867         * mf-runtime.h (heur_proc_map): New libmudflap option.
868         * mf-runtime.c (__mf_set_default_options): Set it.
869         (__mf_usage): Print default values/status.
870         (__mf_process_opts): Support general "no-" option string prefix.
871         (__mf_init): Print __mf_usage on unknown-option error.
872         (__mf_register): Print trace message up front.
873         Correct region splitting logic for case where a subregion disappears.
874         Correct memory leak.
875         (__mf_violation): Make even basic message conditional on option.
877         Build cleanup:
878         * Makefile.am (TESTS_ENVIRONMENT): Add -no-heur-proc-map.
879         (clean-local): New target.
880         (test/*x rules): Add -g CFLAGS.
881         (CFLAGS): Add -freorder-blocks.
882         (MFCONFIG_CFLAGS, INCLUDE): Remove unneeded settings.
883         * Makefile.in: Regenerated.
884         * Makefile, mf-config.h: Removed files.
886 2002-08-16  Graydon Hoare  <graydon@redhat.com>
888         * mf-runtime.c (__mf_insert_new_object): Factor out of
889         __mf_register.
890         (__mf_remove_old_object): Factor out of __mf_unregister.
891         (__mf_register): Handle guessed regions, splitting
892         guesses when new registrations arrive.
893         (__mf_unregister): Do not unregister guesses.
894         * mf-runtime.h: Move convenience macros around, 
895         declare new option fields. Add __MF_TYPE_GUESS.
896         * mf-hooks.c (__wrap_*alloc): Use crumple zones.
897         (__wrap_free): Call __real_free for deferred frees.
898         * Makefile.am: Add more tests, fix dependency.
899         * Makefile.in: Regenerate.
900         * test/pass[13..17]-frag.c: New testcases.
901         * test/fail[13..17]-frag.c: New testcases.
903 2002-08-15  Graydon Hoare  <graydon@redhat.com>
905         * mf-heuristics.c: New file.
906         * mf-runtime.c (options): Add -trace-calls option.
907         (__mf_init): Call __mf_init_heuristics.
909 2002-08-14  Graydon Hoare  <graydon@redhat.com>
911         * Makefile.am (TESTS): Add testsuite support.
912         * Makefile.in: Regenerate.
913         * test/mf-driver.c: New file.
914         * test/buildtest.sh: New file.
915         * test/passNN-frag.c: New testcases.
916         * test/failNN-frag.c: New testcases.
918 2002-08-14  Graydon Hoare  <graydon@redhat.com>
920         * mf-hooks.c: Change __real_strlen() to __real_strlen()+1 when
921         verifying non-size-limited string extents.
923 2002-08-14  Frank Ch. Eigler  <fche@redhat.com>
925         * mf-hooks.c: Make __wrap string* functions use __real_str[n]len
926         instead of plain str[n]len for internal checks.
927         * mf-runtime.c (__mf_violation): Print optional stack traceback.
929 2002-08-14  Frank Ch. Eigler  <fche@redhat.com>
931         * mf-hooks.c: Remove #if-0 around hooks that are now ld-wrapped.
933 2002-08-13  Graydon Hoare  <graydon@redhat.com>
935         * mf-runtime.c: Rework configuration to operate on
936         environment variable options rather than #defines
937         (__mf_violation): Add simple fork-a-gdb violaiton mode.
938         (__mf_init): Set static __mf_active_p flag on startup,
939         to inhibit mudflap wrap-based checking during crt0.s.
940         * mf-runtime.h: Declare options structure.
941         * mf-hooks.c: New wrappings for mem*, b*, str*
942         libc functions (temporarily #if 0-ed out).
944 2002-08-12  Frank Ch. Eigler  <fche@redhat.com>
946         * Makefile.am, configure.in: New files.
947         * Makefile.in, Makefile, configure, config.h.in: New generated files.
948         * stamp-h.in, aclocal.m4: Ditto.
950 2002-08-08  Frank Ch. Eigler  <fche@redhat.com>
952         * Makefile: New file.
953         * mf-config.h: New file: runtime configuration.
954         * mf-hooks.c: New file: interposed libc functions.
955         * mf-runtime.c: New file: bulk of runtime.
956         * mf-runtime.h: New file: public functions.