]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Removed code that has been commented out recently.
authorBart Van Assche <bvanassche@acm.org>
Sun, 26 Jul 2009 08:48:49 +0000 (08:48 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 26 Jul 2009 08:48:49 +0000 (08:48 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10606

drd/drd_clientreq.c
drd/drd_clientreq.h
drd/drd_pthread_intercepts.c

index 82820a1a18b9cf3c033b102d5400348f787e27ff..14f0b47b2260b60beebf4fe73e9b7ff1cc04e796 100644 (file)
@@ -47,9 +47,6 @@
 /* Local function declarations. */
 
 static Bool handle_client_request(ThreadId vg_tid, UWord* arg, UWord* ret);
-#if 0
-static Addr highest_used_stack_address(const ThreadId vg_tid);
-#endif
 
 
 /* Function definitions. */
@@ -175,39 +172,6 @@ static Bool handle_client_request(ThreadId vg_tid, UWord* arg, UWord* ret)
       }
       break;
 
-   case VG_USERREQ__DRD_SUPPRESS_CURRENT_STACK:
-      {
-#if 0
-         const Addr topmost_sp = highest_used_stack_address(vg_tid);
-#if 0
-         UInt nframes;
-         const UInt n_ips = 20;
-         Addr ips[n_ips], sps[n_ips], fps[n_ips];
-         Char desc[128];
-         unsigned i;
-
-         nframes = VG_(get_StackTrace)(vg_tid, ips, n_ips, sps, fps, 0);
-
-         VG_(message)(Vg_DebugMsg, "thread %d: stack 0x%lx - 0x%lx - 0x%lx\n",
-                     drd_tid,
-                     VG_(thread_get_stack_max)(vg_tid)
-                     - VG_(thread_get_stack_size)(vg_tid),
-                     topmost_sp,
-                     VG_(thread_get_stack_max)(vg_tid));
-         for (i = 0; i < nframes; i++)
-         {
-            VG_(describe_IP)(ips[i], desc, sizeof(desc));
-            VG_(message)(Vg_DebugMsg, "[%2d] sp 0x%09lx fp 0x%09lx ip %s\n",
-                         i, sps[i], fps[i], desc);
-         }
-#endif
-         DRD_(thread_set_stack_startup)(drd_tid, VG_(get_SP)(vg_tid));
-         DRD_(start_suppression)(topmost_sp, VG_(thread_get_stack_max)(vg_tid),
-                                 "stack top");
-#endif
-         break;
-      }
-
    case VG_USERREQ__DRD_START_NEW_SEGMENT:
       DRD_(thread_new_segment)(DRD_(PtThreadIdToDrdThreadId)(arg[1]));
       break;
@@ -503,49 +467,3 @@ static Bool handle_client_request(ThreadId vg_tid, UWord* arg, UWord* ret)
    *ret = result;
    return True;
 }
-
-#if 0
-/**
- * Walk the stack up to the highest stack frame, and return the stack pointer
- * of the highest stack frame. It is assumed that there are no more than
- * ten stack frames above the current frame. This should be no problem
- * since this function is either called indirectly from the _init() function
- * in vgpreload_drd-*.so or from the thread wrapper for a newly created
- * thread. See also drd_pthread_intercepts.c.
- */
-static Addr highest_used_stack_address(const ThreadId vg_tid)
-{
-   UInt nframes;
-   const UInt n_ips = 10;
-   UInt i;
-   Addr ips[n_ips], sps[n_ips];
-   Addr husa;
-
-   nframes = VG_(get_StackTrace)(vg_tid, ips, n_ips, sps, 0, 0);
-   tl_assert(1 <= nframes && nframes <= n_ips);
-
-   /* A hack to work around VG_(get_StackTrace)()'s behavior that sometimes */
-   /* the topmost stackframes it returns are bogus (this occurs sometimes   */
-   /* at least on amd64, ppc32 and ppc64).                                  */
-
-   husa = sps[0];
-
-   tl_assert(VG_(thread_get_stack_max)(vg_tid)
-             - VG_(thread_get_stack_size)(vg_tid) <= husa
-             && husa < VG_(thread_get_stack_max)(vg_tid));
-
-   for (i = 1; i < nframes; i++)
-   {
-      if (sps[i] == 0)
-         break;
-      if (husa < sps[i] && sps[i] < VG_(thread_get_stack_max)(vg_tid))
-         husa = sps[i];
-   }
-
-   tl_assert(VG_(thread_get_stack_max)(vg_tid)
-             - VG_(thread_get_stack_size)(vg_tid) <= husa
-             && husa < VG_(thread_get_stack_max)(vg_tid));
-
-   return husa;
-}
-#endif
index c282a736c4d6a54d7ae36f88136d9e377c675610..0b5536804797896e3ac6bed785f8c8ae8b9eb966 100644 (file)
  * source files.
  */
 enum {
-   /* Ask drd to suppress data race reports on all currently allocated stack */
-   /* data of the current thread.                                            */
-   VG_USERREQ__DRD_SUPPRESS_CURRENT_STACK = VG_USERREQ_TOOL_BASE('D', 'r'),
-   /* args: none */
    /* To ask the drd tool to start a new segment in the specified thread. */
-   VG_USERREQ__DRD_START_NEW_SEGMENT,
+   VG_USERREQ__DRD_START_NEW_SEGMENT = VG_USERREQ_TOOL_BASE('D', 'r'),
    /* args: POSIX thread ID. */
 
    /* Tell drd the pthread_t of the running thread. */
index b9ef24f9b179398c16ca20da0b0b3e563840902b..7639f10102fa4876aac6de9be4c16b5d4400f647 100644 (file)
@@ -217,9 +217,6 @@ static void* DRD_(thread_wrapper)(void* arg)
    DrdPosixThreadArgs* arg_ptr;
    DrdPosixThreadArgs arg_copy;
 
-   VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__DRD_SUPPRESS_CURRENT_STACK,
-                              0, 0, 0, 0, 0);
-
    arg_ptr = (DrdPosixThreadArgs*)arg;
    arg_copy = *arg_ptr;
 #if defined(WAIT_UNTIL_CREATED_THREAD_STARTED)
@@ -306,9 +303,6 @@ static void DRD_(set_main_thread_state)(void)
 {
    int res;
 
-   VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__DRD_SUPPRESS_CURRENT_STACK,
-                              0, 0, 0, 0, 0);
-
    // Make sure that DRD knows about the main thread's POSIX thread ID.
    VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__SET_PTHREADID,
                               pthread_self(), 0, 0, 0, 0);