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