From: Bart Van Assche Date: Thu, 28 Feb 2008 20:28:00 +0000 (+0000) Subject: Simplified stack tracking. X-Git-Tag: svn/VALGRIND_3_4_0~1007 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d41c76e877cbf88eb54dc68555932e745465b696;p=thirdparty%2Fvalgrind.git Simplified stack tracking. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7504 --- diff --git a/exp-drd/drd_main.c b/exp-drd/drd_main.c index 07a9d5f883..4867205d61 100644 --- a/exp-drd/drd_main.c +++ b/exp-drd/drd_main.c @@ -283,23 +283,13 @@ static void drd_stop_using_mem(const Addr a1, const Addr a2) drd_suppression_stop_using_mem(a1, a2); } -static VG_REGPARM(2) - void drd_make_stack_uninit(const Addr base, const UWord len) -{ -#if 0 - VG_(message)(Vg_DebugMsg, "make_stack_uninit(0x%lx, %ld)", base, len); -#endif - drd_stop_using_mem(base, base + len); -} - /* Called by the core when the stack of a thread grows, to indicate that */ /* the addresses in range [ a, a + len [ may now be used by the client. */ /* Assumption: stacks grow downward. */ static void drd_start_using_mem_stack(const Addr a, const SizeT len) { thread_set_stack_min(thread_get_running_tid(), a - VG_STACK_REDZONE_SZB); - drd_start_using_mem(a - VG_STACK_REDZONE_SZB, - a - VG_STACK_REDZONE_SZB + len); + drd_start_using_mem(a, a + len); } /* Called by the core when the stack of a thread shrinks, to indicate that */ @@ -310,8 +300,7 @@ static void drd_stop_using_mem_stack(const Addr a, const SizeT len) thread_set_vg_running_tid(VG_(get_running_tid)()); thread_set_stack_min(thread_get_running_tid(), a + len - VG_STACK_REDZONE_SZB); - drd_stop_using_mem(a - VG_STACK_REDZONE_SZB, - a + len - VG_STACK_REDZONE_SZB); + drd_stop_using_mem(a, a + len); } static void drd_start_using_mem_mmap(Addr a, SizeT len, @@ -598,20 +587,6 @@ IRSB* drd_instrument(VgCallbackClosure* const closure, instrument = VG_(seginfo_sect_kind)(st->Ist.IMark.addr) != Vg_SectPLT; break; - case Ist_AbiHint: - addStmtToIRSB(bb, - IRStmt_Dirty( - unsafeIRDirty_0_N( - /*regparms*/2, - "drd_make_stack_uninit", - VG_(fnptr_to_fnentry)(drd_make_stack_uninit), - mkIRExprVec_2(st->Ist.AbiHint.base, - mkIRExpr_HWord((UInt)st->Ist.AbiHint.len)) - ) - ) - ); - break; - case Ist_MBE: instrument_memory_bus_event(bb, st->Ist.MBE.event); addStmtToIRSB(bb, st); diff --git a/exp-drd/tests/tc09_bad_unlock.stderr.exp b/exp-drd/tests/tc09_bad_unlock.stderr.exp index 40b301ccc5..b20cc188af 100644 --- a/exp-drd/tests/tc09_bad_unlock.stderr.exp +++ b/exp-drd/tests/tc09_bad_unlock.stderr.exp @@ -23,6 +23,11 @@ Not a mutex by 0x........: nearly_main (tc09_bad_unlock.c:41) by 0x........: main (tc09_bad_unlock.c:49) +Mutex reinitialization: address 0x........, recursion count 0, owner 1. + at 0x........: pthread_mutex_init (drd_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:23) + by 0x........: main (tc09_bad_unlock.c:50) + Attempt to unlock a mutex that is not locked: address 0x........, recursion count -1, owner 1. at 0x........: pthread_mutex_unlock (drd_intercepts.c:?) by 0x........: nearly_main (tc09_bad_unlock.c:27) @@ -47,4 +52,4 @@ Not a mutex by 0x........: nearly_main (tc09_bad_unlock.c:41) by 0x........: main (tc09_bad_unlock.c:50) -ERROR SUMMARY: 8 errors from 8 contexts (suppressed: 0 from 0) +ERROR SUMMARY: 9 errors from 9 contexts (suppressed: 0 from 0)