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