summaryrefslogtreecommitdiff
path: root/libmudflap/mf-runtime.c
Commit message (Collapse)AuthorAgeFilesLines
* 2005-08-17 Kelley Cook <kcook@gcc.gnu.org>kcook2005-08-171-2/+2
| | | | | | | * All files: Update FSF address. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103197 138bc75d-0d04-0410-961f-82ee72b054a4
* * mf-runtime.c (__mf_state_1): Initialize to reentrant.uweigand2005-08-141-2/+4
| | | | | | | | | | | | | (__mf_init): Set thread state active. * mf-hooks3.c (__mf_pthread_spawner): Always set thread state active. (pthread_create wrapper): Always use thread spawner. * testsuite/libmudflap.cth/pass37-frag.c: Increase timeout. * testsuite/libmudflap.cth/pass39-frag.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103084 138bc75d-0d04-0410-961f-82ee72b054a4
* * gcc.c (MFWRAP_SPEC): Don't wrap pthread_join or pthread_exit.rth2005-07-171-19/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * acinclude.m4: New file. * configure.ac: Invoke LIBMUDFLAP_CHECK_TLS. * configure, config.h.in, Makefile.in, testsuite/Makefile.in: Rebuild. * mf-hooks1.c (__mf_0fn_malloc): Move body from ... (__mf_0fn_calloc): ... here. * mf-hooks3.c (struct pthread_info): Remove. (__mf_pthread_info, __mf_pthread_info_idx): Remove. (LIBMUDFLAPTH_THREADS_MAX): Set to 1021. (struct mf_thread_data): New. (mf_thread_data, mf_thread_data_lock): New. (__mf_allocate_blank_threadinfo): Remove. (__mf_find_threadinfo): Rewrite and simplify. Only use if TLS is not available. (__mf_state_perthread): Remove. (__mf_get_state, __mf_set_state): New. (__mf_pthread_cleanup): Use &errno, rather than saved pointer. Update mf_thread_data killing procedure. (__mf_pthread_spawner): Similarly. (__mf_0fn_pthread_create): Only use wrapper if necessary. Remove code to allocate thread stack space. (__mf_0fn_pthread_join, pthread_join): Remove. (__mf_0fn_pthread_exit, pthread_exit): Remove. * mf-impl.h (dyn_pthread_join, dyn_pthread_exit): Remove. (__mf_state_1): Rename from __mf_state; use TLS when available. (__mf_get_state, __mf_set_state): New. Update all users. * mf-runtime.c (begin_recursion_protect1): New. (BEGIN_RECURSION_PROTECT): Use it. (__mf_state_1): Rename from __mf_state; use TLS when available. (threads_active_p): Remove. (__mf_usage): Compute it directly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102108 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-06-15 Frank Ch. Eigler <fche@redhat.com>fche2005-06-151-5/+5
| | | | | | | | | Fix for uncaching bug reported by Herman ten Brugge. * mf-runtime.c (__mf_uncache_object): Search whole cache. * testsuite/libmudflap.c/fail40-frag.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100985 138bc75d-0d04-0410-961f-82ee72b054a4
* * mf-runtime.c (__mfu_unregister): Warning fix for char unsigned.amodra2005-04-041-3/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97532 138bc75d-0d04-0410-961f-82ee72b054a4
* * mf-heuristics.c: Fix whitespace at end of line.mrs2005-03-221-138/+138
| | | | | | | | | | | | * mf-hooks1.c: Likewise. * mf-hooks2.c: Likewise. * mf-hooks3.c: Likewise. * mf-impl.h: Likewise. * mf-runtime.c: Likewise. * mf-runtime.h: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96850 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-03-17 Frank Ch. Eigler <fche@redhat.com>fche2005-03-171-1/+3
| | | | | | | | * mf-runtime.c (__mfu_check): Respect ignore_reads configuration. * testsuite/libmudflap.c/{pass56,fail39}-frag.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96620 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-10-12 Frank Ch. Eigler <fche@redhat.com>fche2004-10-131-6/+52
| | | | | | | | | | | | | | | | | | | | | * configure.ac: Check for more headers, functions. * mf-hooks2.c (mkbuffer, unmkbuffer): New helper functions for tracking overridden FILE buffers. (fopen, setvbuf): New/revised hook functions for buffer overriding. (setbuf,setlinebuf,fdopen,freopen,fopen64,freopen64,fclose): Ditto. (fflush): Accept given NULL stream (means "all streams"). * mf-runtime.h.in: * mf-runtime.c (__mfu_check): Accept accesses that span adjacent HEAP/GUESS objects. (LOOKUP_CACHE_SIZE_MAX): Raise to 64K entries tentatively. (__mf_adapt_cache): Use them all. * testsuite/libmudflap.c/pass35-frag.c: Update warning message. * testsuite/libmudflap.c++/ctors.exp: Ditto. * testsuite/libmudflap.c/{pass51,pass52}-frag.c: New tests. * configure, config.h.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88996 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-10-04 Frank Ch. Eigler <fche@redhat.com>fche2004-10-041-10/+11
| | | | | | | | | | | | | * configure.ac: Look for more headers & functions. * mf-hooks2.c (getmntent, inet_ntoa, getproto*): New wrapper functions. * mf-runtime.h.in: Add new "#pragma redefine_extname"s for them. * mf-runtime.c (options): Clean up integer signedness warnings. (main): Add a declaration to fix a warning. * mf-hooks3.c (pthread_exit): Add not-reached exit() to wrapper. * configure, config.h.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88517 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-09-07 Frank Ch. Eigler <fche@redhat.com>fche2004-09-071-2/+4
| | | | | | | | | | | | | | | | * configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions. * mf-hooks2.c (strerror): Unregister previous string returned by previous strerror. (getlogin,cuserid,getpwnam,getpwuid,getgrnam,getgrgid): New wrappers. (getservent,getservbyname,getservbyport,gai_strerror): Ditto. * mf-runtime.h.in: Add redefine_extname pragmas for them all. * mf-runtime.c (__mf_describe_object): Clarify object life status. * testsuite/libmudflap.c/pass48-frag.c, pass49-frag.c, fail32-frag.c: New tests. * configure, config.h.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87160 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-08-03 Dale Johannesen <dalej@apple.com>fche2004-08-031-1/+1
| | | | | | | * mf-runtime.c: Conditionalize POSIX_SOURCE for Darwin. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85478 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-08-03 Frank Ch. Eigler <fche@redhat.com>fche2004-08-031-23/+11
| | | | | | | | * mf-runtime.c (compare_uintptr_t): Remove function. Inline simplified contents in all former callers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85475 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-07-27 Ulrich Weigand <weigand@informatik.uni-erlangen.de>fche2004-07-271-0/+6
| | | | | | | | * mf-runtime.c (__mf_fini): Set mudflap_mode to mode_nop in the statically linked case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85229 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-07-27 Frank Ch. Eigler <fche@redhat.com>fche2004-07-271-33/+582
| | | | | | | | | | | * splay-tree.[ch]: Remove. Merge contents into ... * mf-runtime.c: ... here, renaming symbols and making all functions static. Remove unused min/max functions. * Makefile.am: Forget about splay-tree.[ch]. * Makefile.in, testsuite/Makefile.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85224 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-07-21 Frank Ch. Eigler <fche@redhat.com>fche2004-07-211-3/+8
| | | | | | | | | | | * mf-runtime.c (__mfu_check): Remove mistaken mode-nop handling. (__mfu_usage): Include (C) 2004. * mf-hooks3.c (__mf_find_threadinfo): Don't call tracing functions here. Include a comment explaining why. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85014 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-07-20 Frank Ch. Eigler <fche@redhat.com>fche2004-07-201-3/+12
| | | | | | | | | | | | | * mf-impl.h (__mf_options): Add ignore_reads and timestamps fields. * mf-runtime.c (options): Give them a name. (__mf_set_default_options): Set them. (__mf_insert_new_object, __mfu_unregister): Optionalize timestamps. (__mf_violation): Warning cleanup. * mf-impl.h (MF_VALIDATE_EXTENT): Support ignore_reads option. * splay-tree.c (splay_tree_delete_helper): Remove obsolete decl. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84971 138bc75d-0d04-0410-961f-82ee72b054a4
* * Fix for g++/15861fche2004-07-151-2/+6
| | | | | | | | | | | 2004-07-15 Frank Ch. Eigler <fche@redhat.com> g++/15861 * mf-runtime.c (__mf_init): Make it non-static. Tolerate repeated invocation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84761 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-06-29 Frank Ch. Eigler <fche@redhat.com>fche2004-06-291-2/+2
| | | | | | | | | | | | | | | | | Splay tree implementation fork. * splay-tree.c, splay-tree.h: Copied & modified from libiberty. Use hard-coded comparison function for uintptr_t. Remove key/value deallocation logic. Cache last splayed key for consecutive lookups. * Makefile.am, Makefile.in: Use them, don't link to them. * mf-runtime.c (__mf_object_tree): Adapt to simpler splay_tree_new. (__mf_find_objects2): Flip successor/predecessor search sequence. * ansidecl.h, libiberty.h: Removed dummy files. 2004-06-29 Nick Clifton <nickc@redhat.com> git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83879 138bc75d-0d04-0410-961f-82ee72b054a4
* (pthread_join): Only apply the weak pragma if the function actually exists.nickc2004-06-291-0/+4
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83847 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-06-24 Frank Ch. Eigler <fche@redhat.com>fche2004-06-241-1114/+838
| | | | | | | | | | | | | | | Adopt splay trees for object database. * Makefile.am: Copy splay-tree.* from libiberty. * Makefile.in, testsuite/Makefile.in: Regenerated. * mf-runtime.h.in (__mf_unregister): Add third parameter (type). * mf-hooks[123].c (*): Add new third parameter to mf_unregister. * mf-impl.h (BEGIN_PROTECT): Remove some trace text. * mf-runtime.c: Rewrite code dealing with object database to use libiberty splay trees. Remove tree liveness aging option. * testsuite/libmudflap.c/fail18-frag.c: Add volatile flag. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83611 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-06-09 Frank Ch. Eigler <fche@redhat.com>fche2004-06-091-0/+6
| | | | | | | | | | | | | | | ctype support. * configure.in: Look for ctype header and glibc implementation. * mf-hooks2.c (__ctype_{b,toupper,tolower}_loc): Sample ctype array hooks for glibc 2.3. * mf-runtime.h.in: Wrap them. * mf-runtime.c (__mf_init): Leave marker regarding other ctype implementations. * testsuite/libmudflap.c/pass47-frag.c: New test. * configure, config.h.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82848 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-06-04 Frank Ch. Eigler <fche@redhat.com>fche2004-06-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Portability improvements, e.g., libmudflap/15293. * configure.in: Look for glibc extension functions. Look for support of -f{function,data}-sections. Look for more headers. Create testsuite/mfconfig.exp. Correct more "test x.." thinkos. * Makefile.am: Use $(SECTION_FLAGS). Collapse piecemeal-compiled mf-hooks* into usual single object per source. * mf-hooks*.c: Remove all #if WRAP_foo conditionals. * mf-hooks2.c: #include a bunch more system headers. Define strnlen if system doesn't provide one. * mf-hooks3.c (struct pthread_info): Add stack_*_alloc fields. (pthread_create): Use it to properly GC dead thread stacks. * mf-runtime.c (__mf_violation): Correct snprintf type warning. * testsuite/Makefile.am: Stop generating site.exp. * testsuite/mfconfig.exp.in: New file. * testsuite/config/default.exp: Load new mfconfig.exp. * testsuite/lib/libmudflap.exp (libmudflap-init): Add extra libraries. (prune_gcc_output): Add glibc static linking warnings. * testsuite/libmudflap.*/*frags.exp: Enumerate needed -lmudflap* libs. * testsuite/libmudflap.c/pass46-frag.c: Ditto. * configure, Makefile, aclocal.m4, config.h.in, testsuite/Makefile.in: Regenerated with autoconf 2.57 and automake 1.7. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82632 138bc75d-0d04-0410-961f-82ee72b054a4
* * configure.in (LIBMUDFLAPTH): Fix thinko.bothner2004-06-041-2/+2
| | | | | | | | | | | * configure.in: Check for more headers. * mf-hooks2.c: Conditionalize on HAVE_SYS_SOCKET_H etc. * mf-runtime.c: In two places conditionalize on SIUSR1 rather than HAVE_SIGNAL as mingw has signal.h but not SIUSR1. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82627 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-05-17 Frank Ch. Eigler <fche@redhat.com>fche2004-05-171-0/+2
| | | | | | | | | | | | | * lib/libmudflap.exp (libmudflap-init): For C++ test cases only, import some build settings from libstdc++-v3 testsuite_flags. * .../cfrags.exp, .../c++frags.exp, .../cthfrags.exp: Corresponding changes to pass test language. * mf-runtime.c (__mfu_check): Poison the cache with antidote for quicker mode-nop handling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81944 138bc75d-0d04-0410-961f-82ee72b054a4
* Merge tree-ssa-20020619-branch into mainline.dnovillo2004-05-131-0/+2431
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81764 138bc75d-0d04-0410-961f-82ee72b054a4