diff options
| author | 2008-09-22 06:06:23 +0000 | |
|---|---|---|
| committer | 2008-09-22 06:06:23 +0000 | |
| commit | 990ef98b53b5d26275756aa3fd4fbbe12fc491bc (patch) | |
| tree | 4a023a169d14f0d41fc7da26f8cc8532c6199956 /src/emu/debug | |
| parent | aca7c102f4550d49cb27f5ea5942281f16c374e3 (diff) | |
02280: any set with multiple CPUs: Disassembler freezes when doing a Run on any CPU other than CPU 0
Diffstat (limited to 'src/emu/debug')
| -rw-r--r-- | src/emu/debug/debugcpu.c | 68 | ||||
| -rw-r--r-- | src/emu/debug/debugcpu.h | 2 | ||||
| -rw-r--r-- | src/emu/debug/debugvw.c | 2 |
3 files changed, 50 insertions, 22 deletions
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c index 89f778df3c9..4eecd7115c4 100644 --- a/src/emu/debug/debugcpu.c +++ b/src/emu/debug/debugcpu.c @@ -55,6 +55,7 @@ struct _debugger_private debug_cpu_info cpuinfo[MAX_CPU]; debug_cpu_info *livecpu; debug_cpu_info *visiblecpu; + debug_cpu_info *breakcpu; UINT8 within_instruction_hook; UINT8 vblank_occurred; @@ -424,30 +425,38 @@ void debug_cpu_start_hook(running_machine *machine, int cpunum, attotime endtime /* update the target execution end time */ info->endexectime = endtime; - /* if a VBLANK occurred, check on things */ - if (global.vblank_occurred && global.execution_state != EXECUTION_STATE_STOPPED) + /* if we're running, do some periodic updating */ + if (global.execution_state != EXECUTION_STATE_STOPPED) { - global.vblank_occurred = FALSE; - - /* if we were waiting for a VBLANK, signal it now */ - if ((info->flags & DEBUG_FLAG_STOP_VBLANK) != 0) + /* check for periodic updates */ + if (info == global.visiblecpu && osd_ticks() > global.last_periodic_update_time + osd_ticks_per_second()/4) { - global.execution_state = EXECUTION_STATE_STOPPED; - debug_console_printf("Stopped at VBLANK\n"); + debug_view_update_all(); + global.last_periodic_update_time = osd_ticks(); } - - /* check for debug keypresses */ - else if (ui_input_pressed(machine, IPT_UI_DEBUG_BREAK)) + + /* check for pending breaks */ + else if (info == global.breakcpu) { global.execution_state = EXECUTION_STATE_STOPPED; - debug_console_printf("User-initiated break\n"); + global.breakcpu = NULL; } - /* while we're here, check for a periodic update */ - else if (info == global.visiblecpu && osd_ticks() > global.last_periodic_update_time + osd_ticks_per_second()/4) + /* if a VBLANK occurred, check on things */ + if (global.vblank_occurred) { - debug_view_update_all(); - global.last_periodic_update_time = osd_ticks(); + global.vblank_occurred = FALSE; + + /* if we were waiting for a VBLANK, signal it now */ + if ((info->flags & DEBUG_FLAG_STOP_VBLANK) != 0) + { + global.execution_state = EXECUTION_STATE_STOPPED; + debug_console_printf("Stopped at VBLANK\n"); + } + + /* check for debug keypresses */ + else if (ui_input_pressed(machine, IPT_UI_DEBUG_BREAK)) + debug_cpu_halt_on_next_instruction(machine, -1, "User-initiated break\n"); } } @@ -593,6 +602,7 @@ void debug_cpu_instruction_hook(running_machine *machine, offs_t curpc) /* reset any transient state */ reset_transient_flags(machine); + global.breakcpu = NULL; /* update all views */ debug_view_update_all(); @@ -928,17 +938,35 @@ const debug_cpu_info *debug_get_cpu_info(int cpunum) the debugger on the next instruction -------------------------------------------------*/ -void debug_cpu_halt_on_next_instruction(running_machine *machine, const char *fmt, ...) +void debug_cpu_halt_on_next_instruction(running_machine *machine, int cpunum, const char *fmt, ...) { + debug_cpu_info *info; va_list arg; + + /* pick the best CPU to land on */ + if (cpunum != -1) + info = &global.cpuinfo[cpunum]; + else if (global.visiblecpu != NULL) + info = global.visiblecpu; + else + info = global.livecpu; + + /* if something is pending on this CPU already, ignore this request */ + if (info != NULL && info == global.breakcpu) + return; va_start(arg, fmt); debug_console_vprintf(fmt, arg); va_end(arg); - global.execution_state = EXECUTION_STATE_STOPPED; - if (global.livecpu != NULL) - compute_debug_flags(machine, global.livecpu); + if (info == global.livecpu) + { + global.execution_state = EXECUTION_STATE_STOPPED; + if (global.livecpu != NULL) + compute_debug_flags(machine, global.livecpu); + } + else + global.breakcpu = info; } diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h index b4985354c31..d17a91c84c4 100644 --- a/src/emu/debug/debugcpu.h +++ b/src/emu/debug/debugcpu.h @@ -247,7 +247,7 @@ void debug_cpu_memory_write_hook(running_machine *machine, int cpunum, int space int debug_cpu_within_instruction_hook(running_machine *machine); const debug_cpu_info *debug_get_cpu_info(int cpunum); -void debug_cpu_halt_on_next_instruction(running_machine *machine, const char *fmt, ...) ATTR_PRINTF(2,3); +void debug_cpu_halt_on_next_instruction(running_machine *machine, int cpunum, const char *fmt, ...) ATTR_PRINTF(3,4); int debug_cpu_is_stopped(running_machine *machine); void debug_cpu_trace_printf(int cpunum, const char *fmt, ...) ATTR_PRINTF(2,3); void debug_cpu_source_script(running_machine *machine, const char *file); diff --git a/src/emu/debug/debugvw.c b/src/emu/debug/debugvw.c index e7ac884c3a8..98939adeaa9 100644 --- a/src/emu/debug/debugvw.c +++ b/src/emu/debug/debugvw.c @@ -585,7 +585,7 @@ void debug_view_end_update(debug_view *view) view->update_pending = 0; /* resize the viewdata if needed */ - size = view->visible_rows*view->visible_cols; + size = view->visible_rows * view->visible_cols; if (size > view->viewdata_size) { view->viewdata_size = size; |
