diff options
author | fche <fche@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-20 20:00:56 +0000 |
---|---|---|
committer | fche <fche@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-20 20:00:56 +0000 |
commit | 80a84069dc74d96566f0be6e6f509df53e6336b0 (patch) | |
tree | df6d56c256a656100ff79a37c174b4b0ce4893cc /libmudflap/mf-runtime.c | |
parent | 916c9cefb227abebb2124d1dc1abeb3435c6814b (diff) | |
download | gcc-80a84069dc74d96566f0be6e6f509df53e6336b0.tar.gz |
2004-07-20 Frank Ch. Eigler <fche@redhat.com>
* 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
Diffstat (limited to 'libmudflap/mf-runtime.c')
-rw-r--r-- | libmudflap/mf-runtime.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libmudflap/mf-runtime.c b/libmudflap/mf-runtime.c index 332b9c2eebf..486880cf3ce 100644 --- a/libmudflap/mf-runtime.c +++ b/libmudflap/mf-runtime.c @@ -237,6 +237,7 @@ __mf_set_default_options () __mf_opts.persistent_count = 100; __mf_opts.crumple_zone = 32; __mf_opts.backtrace = 4; + __mf_opts.timestamps = 1; __mf_opts.mudflap_mode = mode_check; __mf_opts.violation_mode = viol_nop; __mf_opts.heur_std_data = 1; @@ -313,6 +314,12 @@ options [] = {"abbreviate", "abbreviate repetitive listings", set_option, 1, &__mf_opts.abbreviate}, + {"timestamps", + "track object lifetime timestamps", + set_option, 1, &__mf_opts.timestamps}, + {"ignore-reads", + "ignore read accesses - assume okay", + set_option, 1, &__mf_opts.ignore_reads}, {"wipe-stack", "wipe stack objects at unwind", set_option, 1, &__mf_opts.wipe_stack}, @@ -917,7 +924,8 @@ __mf_insert_new_object (uintptr_t low, uintptr_t high, int type, new_obj->name = name; new_obj->alloc_pc = pc; #if HAVE_GETTIMEOFDAY - gettimeofday (& new_obj->alloc_time, NULL); + if (__mf_opts.timestamps) + gettimeofday (& new_obj->alloc_time, NULL); #endif #if LIBMUDFLAPTH new_obj->alloc_thread = pthread_self (); @@ -1157,7 +1165,8 @@ __mfu_unregister (void *ptr, size_t sz, int type) old_obj->deallocated_p = 1; old_obj->dealloc_pc = (uintptr_t) __builtin_return_address (0); #if HAVE_GETTIMEOFDAY - gettimeofday (& old_obj->dealloc_time, NULL); + if (__mf_opts.timestamps) + gettimeofday (& old_obj->dealloc_time, NULL); #endif #ifdef LIBMUDFLAPTH old_obj->dealloc_thread = pthread_self (); @@ -1843,7 +1852,7 @@ __mf_violation (void *ptr, size_t sz, uintptr_t pc, { unsigned dead_p; unsigned num_helpful = 0; - struct timeval now; + struct timeval now = { 0, 0 }; #if HAVE_GETTIMEOFDAY gettimeofday (& now, NULL); #endif |