OSDN Git Service

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