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