]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add debugging hooks, currently disabled.
authorJulian Seward <jseward@acm.org>
Wed, 1 May 2002 00:05:27 +0000 (00:05 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 1 May 2002 00:05:27 +0000 (00:05 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@178

coregrind/vg_scheduler.c
vg_scheduler.c

index 58e71ede133048cf3507b581f13114432b849ebb..536f721f843da91c7f5a5ec70d21e3c5b6c21c05 100644 (file)
@@ -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
index 58e71ede133048cf3507b581f13114432b849ebb..536f721f843da91c7f5a5ec70d21e3c5b6c21c05 100644 (file)
@@ -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