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