Author: bart
Date: 2008-02-28 20:28:00 +0000 (Thu, 28 Feb 2008)
New Revision: 7504

Log:
Simplified stack tracking.

Modified:
   trunk/exp-drd/drd_main.c
   trunk/exp-drd/tests/tc09_bad_unlock.stderr.exp


Modified: trunk/exp-drd/drd_main.c
===================================================================
--- trunk/exp-drd/drd_main.c    2008-02-28 20:27:34 UTC (rev 7503)
+++ trunk/exp-drd/drd_main.c    2008-02-28 20:28:00 UTC (rev 7504)
@@ -283,23 +283,13 @@
    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 @@
    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 @@
          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);

Modified: trunk/exp-drd/tests/tc09_bad_unlock.stderr.exp
===================================================================
--- trunk/exp-drd/tests/tc09_bad_unlock.stderr.exp      2008-02-28 20:27:34 UTC 
(rev 7503)
+++ trunk/exp-drd/tests/tc09_bad_unlock.stderr.exp      2008-02-28 20:28:00 UTC 
(rev 7504)
@@ -23,6 +23,11 @@
    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 @@
    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)


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
Valgrind-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to