OSDN Git Service

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