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