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