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