extern void VG_(scheduler_init) ( void );
+extern void VG_(pp_sched_status) ( void );
/* vg_oursignalhandler() might longjmp(). Here's the jmp_buf. */
extern jmp_buf VG_(scheduler_jmpbuf);
"Valgrind has to exit now. Sorry. Bye!");
VG_(message)(Vg_UserMsg,
"");
+ VG_(pp_sched_status)();
VG_(exit)(1);
}
{
VG_(printf)("\n%s: %s:%d (%s): Assertion `%s' failed.\n",
"valgrind", file, line, fn, expr );
+ VG_(pp_sched_status)();
VG_(printf)("Please report this bug to me at: %s\n\n", EMAIL_ADDR);
VG_(shutdown_logging)();
VG_(exit)(1);
{
VG_(printf)("\nvalgrind: the `impossible' happened:\n %s\n", str);
VG_(printf)("Basic block ctr is approximately %llu\n", VG_(bbs_done) );
+ VG_(pp_sched_status)();
VG_(printf)("Please report this bug to me at: %s\n\n", EMAIL_ADDR);
VG_(shutdown_logging)();
VG_(exit)(1);
Helper functions for the scheduler.
------------------------------------------------------------------ */
-static
-void pp_sched_status ( void )
+/* Print the scheduler status. */
+void VG_(pp_sched_status) ( void )
{
Int i;
VG_(printf)("\nsched status:\n");
for (i = 0; i < VG_N_THREADS; i++) {
if (vg_threads[i].status == VgTs_Empty) continue;
- VG_(printf)("tid %d: ", i);
+ VG_(printf)("\nThread %d: status = ", i);
switch (vg_threads[i].status) {
case VgTs_Runnable: VG_(printf)("Runnable\n"); break;
case VgTs_WaitFD: VG_(printf)("WaitFD\n"); break;
case VgTs_Sleeping: VG_(printf)("Sleeping\n"); break;
default: VG_(printf)("???"); break;
}
+ VG_(pp_ExeContext)(
+ VG_(get_ExeContext)( False, vg_threads[i].m_eip,
+ vg_threads[i].m_ebp ));
}
VG_(printf)("\n");
}
/* No runnable threads and no prospect of any appearing
even if we wait for an arbitrary length of time. In
short, we have a deadlock. */
- pp_sched_status();
+ VG_(pp_sched_status)();
return VgSrc_Deadlock;
}
VG_(message)(Vg_DebugMsg, "thread %d: %ld bbs, event %s",
tid, VG_(bbs_done),
name_of_sched_event(trc) );
-
+ vg_assert(VG_(bbs_done) < 1000000);
/* Examine the thread's return code to figure out why it
stopped, and handle requests. */
extern void VG_(scheduler_init) ( void );
+extern void VG_(pp_sched_status) ( void );
/* vg_oursignalhandler() might longjmp(). Here's the jmp_buf. */
extern jmp_buf VG_(scheduler_jmpbuf);
"Valgrind has to exit now. Sorry. Bye!");
VG_(message)(Vg_UserMsg,
"");
+ VG_(pp_sched_status)();
VG_(exit)(1);
}
{
VG_(printf)("\n%s: %s:%d (%s): Assertion `%s' failed.\n",
"valgrind", file, line, fn, expr );
+ VG_(pp_sched_status)();
VG_(printf)("Please report this bug to me at: %s\n\n", EMAIL_ADDR);
VG_(shutdown_logging)();
VG_(exit)(1);
{
VG_(printf)("\nvalgrind: the `impossible' happened:\n %s\n", str);
VG_(printf)("Basic block ctr is approximately %llu\n", VG_(bbs_done) );
+ VG_(pp_sched_status)();
VG_(printf)("Please report this bug to me at: %s\n\n", EMAIL_ADDR);
VG_(shutdown_logging)();
VG_(exit)(1);
Helper functions for the scheduler.
------------------------------------------------------------------ */
-static
-void pp_sched_status ( void )
+/* Print the scheduler status. */
+void VG_(pp_sched_status) ( void )
{
Int i;
VG_(printf)("\nsched status:\n");
for (i = 0; i < VG_N_THREADS; i++) {
if (vg_threads[i].status == VgTs_Empty) continue;
- VG_(printf)("tid %d: ", i);
+ VG_(printf)("\nThread %d: status = ", i);
switch (vg_threads[i].status) {
case VgTs_Runnable: VG_(printf)("Runnable\n"); break;
case VgTs_WaitFD: VG_(printf)("WaitFD\n"); break;
case VgTs_Sleeping: VG_(printf)("Sleeping\n"); break;
default: VG_(printf)("???"); break;
}
+ VG_(pp_ExeContext)(
+ VG_(get_ExeContext)( False, vg_threads[i].m_eip,
+ vg_threads[i].m_ebp ));
}
VG_(printf)("\n");
}
/* No runnable threads and no prospect of any appearing
even if we wait for an arbitrary length of time. In
short, we have a deadlock. */
- pp_sched_status();
+ VG_(pp_sched_status)();
return VgSrc_Deadlock;
}
VG_(message)(Vg_DebugMsg, "thread %d: %ld bbs, event %s",
tid, VG_(bbs_done),
name_of_sched_event(trc) );
-
+ vg_assert(VG_(bbs_done) < 1000000);
/* Examine the thread's return code to figure out why it
stopped, and handle requests. */