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