25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: debugger.c,v 1.10 2006/06/16 18:31:26 debug Exp $ |
* $Id: debugger.c,v 1.12 2006/06/25 01:25:32 debug Exp $ |
29 |
* |
* |
30 |
* Single-step debugger. |
* Single-step debugger. |
31 |
* |
* |
86 |
* TODO: Some of these should be moved to some other place! |
* TODO: Some of these should be moved to some other place! |
87 |
*/ |
*/ |
88 |
|
|
89 |
volatile int single_step = 0; |
volatile int single_step = NOT_SINGLE_STEPPING; |
90 |
volatile int exit_debugger; |
volatile int exit_debugger; |
91 |
int force_debugger_at_exit = 0; |
int force_debugger_at_exit = 0; |
92 |
int show_opcode_statistics = 0; |
int show_opcode_statistics = 0; |
168 |
{ |
{ |
169 |
ctrl_c = 1; |
ctrl_c = 1; |
170 |
|
|
171 |
if (single_step) { |
if (single_step != NOT_SINGLE_STEPPING) { |
172 |
/* Already in the debugger. Do nothing. */ |
/* Already in the debugger. Do nothing. */ |
173 |
int i; |
int i; |
174 |
for (i=0; i<MAX_CMD_BUFLEN; i++) |
for (i=0; i<MAX_CMD_BUFLEN; i++) |
179 |
fflush(stdout); |
fflush(stdout); |
180 |
} else { |
} else { |
181 |
/* Enter the single step debugger. */ |
/* Enter the single step debugger. */ |
182 |
single_step = 1; |
single_step = ENTER_SINGLE_STEPPING; |
183 |
|
|
184 |
/* Discard any chars in the input queue: */ |
/* Discard any chars in the input queue: */ |
185 |
while (console_charavail(MAIN_CONSOLE)) |
while (console_charavail(MAIN_CONSOLE)) |
792 |
*/ |
*/ |
793 |
/* TODO: In all machines */ |
/* TODO: In all machines */ |
794 |
for (i=0; i<debugger_machine->ncpus; i++) |
for (i=0; i<debugger_machine->ncpus; i++) |
795 |
if (debugger_machine->cpus[i]->translation_cache != NULL) |
if (debugger_machine->cpus[i]->translation_cache != NULL) { |
796 |
cpu_create_or_reset_tc(debugger_machine->cpus[i]); |
cpu_create_or_reset_tc(debugger_machine->cpus[i]); |
797 |
|
debugger_machine->cpus[i]-> |
798 |
|
invalidate_translation_caches( |
799 |
|
debugger_machine->cpus[i], 0, INVALIDATE_ALL); |
800 |
|
} |
801 |
|
|
802 |
/* |
/* |
803 |
* Ugly GDB hack: After single stepping, we need to send back |
* Ugly GDB hack: After single stepping, we need to send back |
862 |
gettimeofday(&debugger_machine->starttime, NULL); |
gettimeofday(&debugger_machine->starttime, NULL); |
863 |
debugger_machine->ncycles_since_gettimeofday = 0; |
debugger_machine->ncycles_since_gettimeofday = 0; |
864 |
|
|
865 |
single_step = 0; |
single_step = NOT_SINGLE_STEPPING; |
866 |
debugger_machine->instruction_trace = old_instruction_trace; |
debugger_machine->instruction_trace = old_instruction_trace; |
867 |
debugger_machine->show_trace_tree = old_show_trace_tree; |
debugger_machine->show_trace_tree = old_show_trace_tree; |
868 |
quiet_mode = old_quiet_mode; |
quiet_mode = old_quiet_mode; |