From: Bart Van Assche Date: Sun, 26 Jul 2009 08:48:49 +0000 (+0000) Subject: Removed code that has been commented out recently. X-Git-Tag: svn/VALGRIND_3_5_0~242 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a0f1a0b56f6d175cca96351054e70499d2e42787;p=thirdparty%2Fvalgrind.git Removed code that has been commented out recently. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10606 --- diff --git a/drd/drd_clientreq.c b/drd/drd_clientreq.c index 82820a1a18..14f0b47b22 100644 --- a/drd/drd_clientreq.c +++ b/drd/drd_clientreq.c @@ -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 diff --git a/drd/drd_clientreq.h b/drd/drd_clientreq.h index c282a736c4..0b55368047 100644 --- a/drd/drd_clientreq.h +++ b/drd/drd_clientreq.h @@ -45,12 +45,8 @@ * 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. */ diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c index b9ef24f9b1..7639f10102 100644 --- a/drd/drd_pthread_intercepts.c +++ b/drd/drd_pthread_intercepts.c @@ -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);