OSDN Git Service

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