From: Julian Seward Date: Wed, 1 May 2002 00:05:27 +0000 (+0000) Subject: Add debugging hooks, currently disabled. X-Git-Tag: svn/VALGRIND_1_0_3~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43330e240be3a93af1c75c4855f4a2bcf8ef4da8;p=thirdparty%2Fvalgrind.git Add debugging hooks, currently disabled. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@178 --- diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c index 58e71ede13..536f721f84 100644 --- a/coregrind/vg_scheduler.c +++ b/coregrind/vg_scheduler.c @@ -1278,9 +1278,24 @@ VgSchedReturnCode VG_(scheduler) ( void ) if (0) VG_(message)(Vg_DebugMsg, "thread %d: running for %d bbs", tid, VG_(dispatch_ctr) - 1 ); +# if 0 + if (VG_(bbs_done) > 31700000 + 0) { + dispatch_ctr_SAVED = VG_(dispatch_ctr) = 2; + VG_(translate)(&vg_threads[tid], vg_threads[tid].m_eip, + NULL,NULL,NULL); + } + vg_assert(vg_threads[tid].m_eip != 0); +# endif trc = run_thread_for_a_while ( tid ); +# if 0 + if (0 == vg_threads[tid].m_eip) { + VG_(printf)("tid = %d, dc = %llu\n", tid, VG_(bbs_done)); + vg_assert(0 != vg_threads[tid].m_eip); + } +# endif + /* Deal quickly with trivial scheduling events, and resume the thread. */ @@ -1317,7 +1332,26 @@ VgSchedReturnCode VG_(scheduler) ( void ) if (trc == VG_TRC_EBP_JMP_SYSCALL) { /* Do a syscall for the vthread tid. This could cause it to become non-runnable. */ +# if 0 + { UInt* esp; Int i; + esp=(UInt*)vg_threads[tid].m_esp; + VG_(printf)("\nBEFORE\n"); + for (i = 10; i >= -10; i--) + VG_(printf)("%2d %p = 0x%x\n", i, &esp[i], esp[i]); + } +# endif + sched_do_syscall(tid); + +# if 0 + { UInt* esp; Int i; + esp=(UInt*)vg_threads[tid].m_esp; + VG_(printf)("AFTER\n"); + for (i = 10; i >= -10; i--) + VG_(printf)("%2d %p = 0x%x\n", i, &esp[i], esp[i]); + } +# endif + if (vg_threads[tid].status == VgTs_Runnable) continue; /* with this thread */ else diff --git a/vg_scheduler.c b/vg_scheduler.c index 58e71ede13..536f721f84 100644 --- a/vg_scheduler.c +++ b/vg_scheduler.c @@ -1278,9 +1278,24 @@ VgSchedReturnCode VG_(scheduler) ( void ) if (0) VG_(message)(Vg_DebugMsg, "thread %d: running for %d bbs", tid, VG_(dispatch_ctr) - 1 ); +# if 0 + if (VG_(bbs_done) > 31700000 + 0) { + dispatch_ctr_SAVED = VG_(dispatch_ctr) = 2; + VG_(translate)(&vg_threads[tid], vg_threads[tid].m_eip, + NULL,NULL,NULL); + } + vg_assert(vg_threads[tid].m_eip != 0); +# endif trc = run_thread_for_a_while ( tid ); +# if 0 + if (0 == vg_threads[tid].m_eip) { + VG_(printf)("tid = %d, dc = %llu\n", tid, VG_(bbs_done)); + vg_assert(0 != vg_threads[tid].m_eip); + } +# endif + /* Deal quickly with trivial scheduling events, and resume the thread. */ @@ -1317,7 +1332,26 @@ VgSchedReturnCode VG_(scheduler) ( void ) if (trc == VG_TRC_EBP_JMP_SYSCALL) { /* Do a syscall for the vthread tid. This could cause it to become non-runnable. */ +# if 0 + { UInt* esp; Int i; + esp=(UInt*)vg_threads[tid].m_esp; + VG_(printf)("\nBEFORE\n"); + for (i = 10; i >= -10; i--) + VG_(printf)("%2d %p = 0x%x\n", i, &esp[i], esp[i]); + } +# endif + sched_do_syscall(tid); + +# if 0 + { UInt* esp; Int i; + esp=(UInt*)vg_threads[tid].m_esp; + VG_(printf)("AFTER\n"); + for (i = 10; i >= -10; i--) + VG_(printf)("%2d %p = 0x%x\n", i, &esp[i], esp[i]); + } +# endif + if (vg_threads[tid].status == VgTs_Runnable) continue; /* with this thread */ else