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