]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Simplified stack tracking.
authorBart Van Assche <bvanassche@acm.org>
Thu, 28 Feb 2008 20:28:00 +0000 (20:28 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 28 Feb 2008 20:28:00 +0000 (20:28 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7504

exp-drd/drd_main.c
exp-drd/tests/tc09_bad_unlock.stderr.exp

index 07a9d5f88364e26cb701d555a9423934bd45e4a9..4867205d61bab18d3c86d137ea038d526c65ef43 100644 (file)
@@ -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);
index 40b301ccc5841356fe6a2d4cb13df93a37ea80da..b20cc188af839c40eb28558f5266dc690b02bf7f 100644 (file)
@@ -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)