|
From: Nicholas N. <nj...@ca...> - 2004-02-01 17:30:06
|
CVS commit by nethercote:
Killed the terminally wounded --stop-after option.
M +2 -3 FAQ.txt 1.20
M +0 -1 coregrind/Makefile.am 1.65
M +2 -31 coregrind/vg_include.h 1.179
M +2 -70 coregrind/vg_main.c 1.144
M +1 -30 coregrind/vg_scheduler.c 1.141
M +0 -22 coregrind/vg_translate.c 1.69
M +0 -7 coregrind/docs/coregrind_core.html 1.26
R coregrind/vg_startup.S 1.22
--- valgrind/FAQ.txt #1.19:1.20
@@ -200,7 +200,6 @@
As of 1.9.6, Valgrind only uses these variables with
- --trace-children=no, when executing execve() or using the
- --stop-after=yes flag. This should reduce the potential for
- problems.
+ --trace-children=no or when executing execve(). This should
+ reduce the potential for problems.
-----------------------------------------------------------------
--- valgrind/coregrind/Makefile.am #1.64:1.65
@@ -64,5 +64,4 @@
vg_dummy_profile.c \
vg_signals.c \
- vg_startup.S \
vg_symtab2.c \
vg_dwarf.c \
--- valgrind/coregrind/vg_include.h #1.178:1.179
@@ -244,6 +244,4 @@ extern Bool VG_(clo_trace_sched);
(some), 2 (all) */
extern Int VG_(clo_trace_pthread_level);
-/* Stop after this many basic blocks. default: Infinity. */
-extern ULong VG_(clo_stop_after);
/* Display gory details for the k'th most popular error. default:
Infinity. */
@@ -823,5 +821,5 @@ typedef
Although the segment registers are 16 bits long, storage
- management here, in VG_(baseBlock) and in VG_(m_state_static) is
+ management here and in VG_(baseBlock) is
simplified if we pretend they are 32 bits. */
UInt m_cs;
@@ -911,6 +909,4 @@ typedef
VgSrc_ExitSyscall, /* client called exit(). This is the normal
route out. */
- VgSrc_BbsDone, /* In a debugging run, the specified number of
- bbs has been completed. */
VgSrc_FatalSig /* Killed by the default action of a fatal
signal */
@@ -1337,5 +1333,5 @@ extern Addr VG_(code_redirect) (Addr o
/* Is this a SSE/SSE2-capable CPU? If so, we had better save/restore
the SSE state all over the place. This is set up very early, in
- vg_startup.S. We have to determine it early since we can't even
+ main(). We have to determine it early since we can't even
correctly snapshot the startup machine state without it. */
extern Bool VG_(have_ssestate);
@@ -1373,23 +1369,4 @@ extern Int VG_(clexecfd);
extern const Char *VG_(libdir);
-/* A structure used as an intermediary when passing the simulated
- CPU's state to VG_(switch_to_real_CPU)(), for --stop-after=yes.
- Stuff is copied from baseBlock to here, because it's much easier
- to copy the state into the real registers from this structure than
- the baseBlock, because it's layout is simpler.
- Alignment: the SSE state must be 16-byte aligned. We ask for the whole
- struct to be 16-byte aligned, and the SSE state starts at the 6+8+1+1th
- == 16th word, so it too must be 16-byte aligned. Consequence: change
- this struct only _very carefully_ ! See also above comment re masking
- MXCSR.
-*/
-__attribute__ ((aligned (16)))
-extern UInt VG_(m_state_static) [6 /* segment regs, Intel order */
- + 8 /* int regs, in Intel order */
- + 1 /* %eflags */
- + 1 /* %eip */
- + VG_SIZE_OF_SSESTATE_W /* SSE state */
- ];
-
/* Determine if %esp adjustment must be noted */
extern Bool VG_(need_to_handle_esp_assignment) ( void );
@@ -1644,10 +1621,4 @@ extern Int VG_(clone) ( Int (*fn)(void *
/* ---------------------------------------------------------------------
- Exports of vg_startup.S
- ------------------------------------------------------------------ */
-
-extern void VG_(switch_to_real_CPU) ( void );
-
-/* ---------------------------------------------------------------------
Exports of vg_dispatch.S
------------------------------------------------------------------ */
--- valgrind/coregrind/vg_main.c #1.143:1.144
@@ -164,6 +164,4 @@ UInt VG_(dispatch_ctr);
/* 64-bit counter for the number of basic blocks done. */
ULong VG_(bbs_done);
-/* 64-bit counter for the number of bbs to go before a debug exit. */
-ULong VG_(bbs_to_go);
/* This is the ThreadId of the last thread the scheduler ran. */
@@ -1426,5 +1424,4 @@ Bool VG_(clo_trace_symtab) = False;
Bool VG_(clo_trace_sched) = False;
Int VG_(clo_trace_pthread_level) = 0;
-ULong VG_(clo_stop_after) = 1000000000000000LL;
Int VG_(clo_dump_error) = 0;
Int VG_(clo_backtrace_size) = 4;
@@ -1529,6 +1526,4 @@ void usage ( Bool debug_help )
" --trace-sched=no|yes show thread scheduler details? [no]\n"
" --trace-pthread=none|some|all show pthread event details? [none]\n"
-" --stop-after=<number> switch to real CPU after executing\n"
-" <number> basic blocks [infinity]\n"
" --wait-for-gdb=yes|no pause on startup to wait for gdb attach\n"
"\n"
@@ -1861,7 +1856,4 @@ static void process_cmd_line_options
VG_(clo_lowlat_syscalls) = False;
- else if (VG_CLO_STREQN(13, arg, "--stop-after="))
- VG_(clo_stop_after) = VG_(atoll)(&arg[13]);
-
else if (VG_CLO_STREQN(13, arg, "--dump-error="))
VG_(clo_dump_error) = (Int)VG_(atoll)(&arg[13]);
@@ -2059,6 +2051,4 @@ static void process_cmd_line_options
" as it doesn't generate errors.");
}
-
- VG_(bbs_to_go) = VG_(clo_stop_after);
}
@@ -2099,5 +2089,5 @@ static void setup_file_descriptors(void)
/*====================================================================*/
-/*=== m_state_static + baseBlock: definition, setup, copying ===*/
+/*=== baseBlock: definition + setup ===*/
/*====================================================================*/
@@ -2189,13 +2179,4 @@ Int VG_(noncompact_helper_offsets)[MAX_
UInt VG_(baseBlock)[VG_BASEBLOCK_WORDS];
-/* See comment about this in vg_include.h. Change only with great care. */
-__attribute__ ((aligned (16)))
-UInt VG_(m_state_static) [6 /* segment regs, Intel order */
- + 8 /* int regs, in Intel order */
- + 1 /* %eflags */
- + 1 /* %eip */
- + VG_SIZE_OF_SSESTATE_W /* FPU state */
- ];
-
/* Words. */
static Int baB_off = 0;
@@ -2225,34 +2206,4 @@ Int VG_(extractDflag)(UInt eflags)
}
-static void copy_baseBlock_to_m_state_static( void )
-{
- Int i;
- VG_(m_state_static)[ 0/4] = VG_(baseBlock)[VGOFF_(m_cs)];
- VG_(m_state_static)[ 4/4] = VG_(baseBlock)[VGOFF_(m_ss)];
- VG_(m_state_static)[ 8/4] = VG_(baseBlock)[VGOFF_(m_ds)];
- VG_(m_state_static)[12/4] = VG_(baseBlock)[VGOFF_(m_es)];
- VG_(m_state_static)[16/4] = VG_(baseBlock)[VGOFF_(m_fs)];
- VG_(m_state_static)[20/4] = VG_(baseBlock)[VGOFF_(m_gs)];
-
- VG_(m_state_static)[24/4] = VG_(baseBlock)[VGOFF_(m_eax)];
- VG_(m_state_static)[28/4] = VG_(baseBlock)[VGOFF_(m_ecx)];
- VG_(m_state_static)[32/4] = VG_(baseBlock)[VGOFF_(m_edx)];
- VG_(m_state_static)[36/4] = VG_(baseBlock)[VGOFF_(m_ebx)];
- VG_(m_state_static)[40/4] = VG_(baseBlock)[VGOFF_(m_esp)];
- VG_(m_state_static)[44/4] = VG_(baseBlock)[VGOFF_(m_ebp)];
- VG_(m_state_static)[48/4] = VG_(baseBlock)[VGOFF_(m_esi)];
- VG_(m_state_static)[52/4] = VG_(baseBlock)[VGOFF_(m_edi)];
-
- VG_(m_state_static)[56/4]
- = VG_(insertDflag)(VG_(baseBlock)[VGOFF_(m_eflags)],
- VG_(baseBlock)[VGOFF_(m_dflag)]);
- VG_(m_state_static)[60/4] = VG_(baseBlock)[VGOFF_(m_eip)];
-
- for (i = 0; i < VG_SIZE_OF_SSESTATE_W; i++)
- VG_(m_state_static)[64/4 + i]
- = VG_(baseBlock)[VGOFF_(m_ssestate) + i];
-}
-
-
/* Returns the offset, in words. */
static Int alloc_BaB ( Int words )
@@ -2873,5 +2824,5 @@ int main(int argc, char **argv)
//--------------------------------------------------------------
- // Set up baseBlock, copy machine state (m_state_static)
+ // Set up baseBlock
// p: {pre,post}_clo_init() [for tool helper registration]
// load_client() [for 'client_eip']
@@ -3105,23 +3056,4 @@ int main(int argc, char **argv)
break;
- case VgSrc_BbsDone:
- /* Tricky; we have to try and switch back to the real CPU.
- This is all very dodgy and won't work at all in the
- presence of threads, or if the client happened to be
- running a signal handler. */
- /* Prepare to restore state to the real CPU. */
- VG_(sigshutdown_actions)();
- VG_(load_thread_state)(1 /* root thread */ );
- copy_baseBlock_to_m_state_static();
-
- VG_(proxy_shutdown)();
-
- /* This pushes a return address on the simulator's stack,
- which is abandoned. We call vg_sigshutdown_actions() at
- the end of vg_switch_to_real_CPU(), so as to ensure that
- the original stack and machine state is restored before
- the real signal mechanism is restored. */
- VG_(switch_to_real_CPU)();
-
case VgSrc_FatalSig:
/* We were killed by a fatal signal, so replicate the effect */
--- valgrind/coregrind/vg_scheduler.c #1.140:1.141
@@ -518,5 +518,4 @@ UInt run_thread_for_a_while ( ThreadId t
vg_assert(VG_(is_valid_tid)(tid));
vg_assert(VG_(threads)[tid].status == VgTs_Runnable);
- vg_assert(VG_(bbs_to_go) > 0);
vg_assert(!VG_(scheduler_jmpbuf_valid));
@@ -902,8 +901,4 @@ VgSchedReturnCode VG_(scheduler) ( void
threads but some are blocked on I/O. */
- /* Was a debug-stop requested? */
- if (VG_(bbs_to_go) == 0)
- goto debug_stop;
-
/* Do the following loop until a runnable thread is found, or
deadlock is detected. */
@@ -997,8 +992,5 @@ VgSchedReturnCode VG_(scheduler) ( void
always get at least one decrement even if nothing happens.
*/
- if (VG_(bbs_to_go) >= VG_SCHEDULING_QUANTUM)
VG_(dispatch_ctr) = VG_SCHEDULING_QUANTUM + 1;
- else
- VG_(dispatch_ctr) = (UInt)VG_(bbs_to_go) + 1;
/* ... and remember what we asked for. */
@@ -1187,5 +1179,4 @@ VgSchedReturnCode VG_(scheduler) ( void
done_this_time = (Int)dispatch_ctr_SAVED - (Int)VG_(dispatch_ctr) - 1;
vg_assert(done_this_time >= 0);
- VG_(bbs_to_go) -= (ULong)done_this_time;
VG_(bbs_done) += (ULong)done_this_time;
@@ -1208,7 +1199,4 @@ VgSchedReturnCode VG_(scheduler) ( void
simply by doing nothing, causing us to arrive back at
Phase 1. */
- if (VG_(bbs_to_go) == 0) {
- goto debug_stop;
- }
break;
@@ -1217,7 +1205,4 @@ VgSchedReturnCode VG_(scheduler) ( void
simply by doing nothing, causing us to arrive back at
Phase 1. */
- if (VG_(bbs_to_go) == 0) {
- goto debug_stop;
- }
vg_assert(VG_(dispatch_ctr) == 0);
break;
@@ -1257,18 +1242,4 @@ VgSchedReturnCode VG_(scheduler) ( void
VG_(core_panic)("scheduler: post-main-loop ?!");
/* NOTREACHED */
-
- debug_stop:
- /* If we exited because of a debug stop, print the translation
- of the last block executed -- by translating it again, and
- throwing away the result. */
- VG_(printf)(
- "======vvvvvvvv====== LAST TRANSLATION ======vvvvvvvv======\n");
- VG_(translate)( tid,
- VG_(threads)[tid].m_eip, NULL, NULL, NULL, NULL );
- VG_(printf)("\n");
- VG_(printf)(
- "======^^^^^^^^====== LAST TRANSLATION ======^^^^^^^^======\n");
-
- return VgSrc_BbsDone;
}
--- valgrind/coregrind/vg_translate.c #1.68:1.69
@@ -1510,26 +1510,4 @@ static void vg_improve ( UCodeBlock* cb
FlagSet future_dead_flags;
-# if 0
- /* DEBUGGING HOOK */
- {
- static int n_done=0;
- if (VG_(clo_stop_after) > 1000000000) {
- if (n_done > (VG_(clo_stop_after) - 1000000000)) {
- dis=False;
- VG_(clo_trace_codegen) = 0;
- return;
- }
- if (n_done == (VG_(clo_stop_after) - 1000000000)) {
- VG_(printf)("\n");
- VG_(pp_UCodeBlock) ( cb, "Incoming:" );
- dis = True;
- VG_(clo_trace_codegen) = 31;
- }
- n_done++;
- }
- }
- /* end DEBUGGING HOOK */
-# endif /* 0 */
-
if (dis)
VG_(printf) ("Improvements:\n");
--- valgrind/coregrind/docs/coregrind_core.html #1.25:1.26
@@ -925,11 +925,4 @@
<p>
- <li><code>--stop-after=<number></code>
- [default: infinity, more or less]
- <p>After <number> basic blocks have been executed, shut down
- Valgrind and switch back to running the client on the real CPU.
- </li><br>
- <p>
-
<li><code>--dump-error=<number></code> [default: inactive]
<p>After the program has exited, show gory details of the
|