summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-07-06 00:52:36 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-07-06 00:52:36 +0000
commit5d21c672af07fa461ae6e0e989d2a866aff509b0 (patch)
treec0762c8e0af859079898f6442488d8f929e8e5d8 /src/osd
parent995097894f775112942bbe13549c9ef8ab6ef3e4 (diff)
Moved debugging structure away from CPUs only and attached to all
devices. Debugger now creates one for each device. C++-ified most debugger operations to hang off the debugging class, and updated most callers. This still needs a little cleanup, but it fixes most issues introduced when the CPUs were moved to their own devices. Got rid of cpu_count, cpu_first, cpu_next, etc. as they were badly broken. Also removed cpu_is_executing, cpu_is_suspended, cpu_get_local_time, and cpu_abort_timeslice. Some minor name changes: state_value() -> state() state_set_value() -> set_state()
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/sdl/debugosx.m40
-rw-r--r--src/osd/sdl/debugwin.c22
-rw-r--r--src/osd/windows/debugwin.c30
3 files changed, 46 insertions, 46 deletions
diff --git a/src/osd/sdl/debugosx.m b/src/osd/sdl/debugosx.m
index f1ec6a733fa..155e137ea98 100644
--- a/src/osd/sdl/debugosx.m
+++ b/src/osd/sdl/debugosx.m
@@ -650,7 +650,7 @@ void console_create_window(running_machine *machine)
- (void)insertNewline:(id)sender {
- debug_cpu_single_step(machine, 1);
+ debug_cpu_get_visible_cpu(machine)->debug()->single_step();
}
@@ -1086,13 +1086,13 @@ void console_create_window(running_machine *machine)
if (bp == NULL)
command = [NSString stringWithFormat:@"bpset %lX", (unsigned long)address];
else
- command = [NSString stringWithFormat:@"bpclear %X", (unsigned)bp->index];
+ command = [NSString stringWithFormat:@"bpclear %X", (unsigned)bp->index()];
debug_console_execute_command(machine, [command UTF8String], 1);
} else {
if (bp == NULL)
- debug_cpu_breakpoint_set(space->cpu, address, NULL, NULL);
+ space->cpu->debug()->breakpoint_set(address, NULL, NULL);
else
- debug_cpu_breakpoint_clear(machine, bp->index);
+ space->cpu->debug()->breakpoint_clear(bp->index());
}
}
}
@@ -1109,13 +1109,13 @@ void console_create_window(running_machine *machine)
if (bp != NULL) {
NSString *command;
if (useConsole) {
- if (bp->enabled)
- command = [NSString stringWithFormat:@"bpdisable %X", (unsigned)bp->index];
+ if (bp->enabled())
+ command = [NSString stringWithFormat:@"bpdisable %X", (unsigned)bp->index()];
else
- command = [NSString stringWithFormat:@"bpenable %X", (unsigned)bp->index];
+ command = [NSString stringWithFormat:@"bpenable %X", (unsigned)bp->index()];
debug_console_execute_command(machine, [command UTF8String], 1);
} else {
- debug_cpu_breakpoint_enable(machine, bp->index, !bp->enabled);
+ space->cpu->debug()->breakpoint_enable(bp->index(), !bp->enabled());
}
}
}
@@ -1132,7 +1132,7 @@ void console_create_window(running_machine *machine)
NSString *command = [NSString stringWithFormat:@"go %lX", (unsigned long)address];
debug_console_execute_command(machine, [command UTF8String], 1);
} else {
- debug_cpu_go(machine, address);
+ debug_cpu_get_visible_cpu(machine)->debug()->go(address);
}
}
}
@@ -1470,49 +1470,49 @@ void console_create_window(running_machine *machine)
- (IBAction)debugRun:(id)sender {
- debug_cpu_go(machine, ~0);
+ debug_cpu_get_visible_cpu(machine)->debug()->go();
}
- (IBAction)debugRunAndHide:(id)sender {
[[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification object:self];
- debug_cpu_go(machine, ~0);
+ debug_cpu_get_visible_cpu(machine)->debug()->go();
}
- (IBAction)debugRunToNextCPU:(id)sender {
- debug_cpu_next_cpu(machine);
+ debug_cpu_get_visible_cpu(machine)->debug()->go_next_device();
}
- (IBAction)debugRunToNextInterrupt:(id)sender {
- debug_cpu_go_interrupt(machine, -1);
+ debug_cpu_get_visible_cpu(machine)->debug()->go_interrupt();
}
- (IBAction)debugRunToNextVBLANK:(id)sender {
- debug_cpu_go_vblank(machine);
+ debug_cpu_get_visible_cpu(machine)->debug()->go_vblank();
}
- (IBAction)debugStepInto:(id)sender {
- debug_cpu_single_step(machine, 1);
+ debug_cpu_get_visible_cpu(machine)->debug()->single_step();
}
- (IBAction)debugStepOver:(id)sender {
- debug_cpu_single_step_over(machine, 1);
+ debug_cpu_get_visible_cpu(machine)->debug()->single_step_over();
}
- (IBAction)debugStepOut:(id)sender {
- debug_cpu_single_step_out(machine);
+ debug_cpu_get_visible_cpu(machine)->debug()->single_step_out();
}
- (IBAction)debugSoftReset:(id)sender {
machine->schedule_soft_reset();
- debug_cpu_go(machine, ~0);
+ debug_cpu_get_visible_cpu(machine)->debug()->go();
}
@@ -1740,7 +1740,7 @@ void console_create_window(running_machine *machine)
- (IBAction)doCommand:(id)sender {
NSString *command = [sender stringValue];
if ([command length] == 0) {
- debug_cpu_single_step(machine, 1);
+ debug_cpu_get_visible_cpu(machine)->debug()->single_step();
} else {
debug_console_execute_command(machine, [command UTF8String], 1);
[history add:command];
@@ -1819,7 +1819,7 @@ void console_create_window(running_machine *machine)
if ([notification object] != window)
return;
[[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification object:self];
- debug_cpu_go(machine, ~0);
+ debug_cpu_get_visible_cpu(machine)->debug()->go();
}
diff --git a/src/osd/sdl/debugwin.c b/src/osd/sdl/debugwin.c
index d8e27ac653a..d53550b363f 100644
--- a/src/osd/sdl/debugwin.c
+++ b/src/osd/sdl/debugwin.c
@@ -491,7 +491,7 @@ void debugwin_update_during_game(running_machine *machine)
static void debugmain_process_string(win_i *win, const char *str)
{
if(!str[0])
- debug_cpu_single_step(win->machine, 1);
+ debug_cpu_get_visible_cpu(win->machine)->debug()->single_step();
else
debug_console_execute_command(win->machine, str, 1);
}
@@ -850,43 +850,43 @@ void on_new_errorlog_activate(GtkWidget *win)
void on_run_activate(GtkWidget *win)
{
- debug_cpu_go(get_running_machine(win), ~0);
+ debug_cpu_get_visible_cpu(get_running_machine(win))->debug()->go();
}
void on_run_h_activate(GtkWidget *win)
{
debugwin_show(0);
- debug_cpu_go(get_running_machine(win), ~0);
+ debug_cpu_get_visible_cpu(get_running_machine(win))->debug()->go();
}
void on_run_cpu_activate(GtkWidget *win)
{
- debug_cpu_next_cpu(get_running_machine(win));
+ debug_cpu_get_visible_cpu(get_running_machine(win))->debug()->go_next_device();
}
void on_run_irq_activate(GtkWidget *win)
{
- debug_cpu_go_interrupt(get_running_machine(win), -1);
+ debug_cpu_get_visible_cpu(get_running_machine(win))->debug()->go_interrupt();
}
void on_run_vbl_activate(GtkWidget *win)
{
- debug_cpu_go_vblank(get_running_machine(win));
+ debug_cpu_get_visible_cpu(get_running_machine(win))->debug()->go_vblank();
}
void on_step_into_activate(GtkWidget *win)
{
- debug_cpu_single_step(get_running_machine(win), 1);
+ debug_cpu_get_visible_cpu(get_running_machine(win))->debug()->single_step();
}
void on_step_over_activate(GtkWidget *win)
{
- debug_cpu_single_step_over(get_running_machine(win), 1);
+ debug_cpu_get_visible_cpu(get_running_machine(win))->debug()->single_step_over();
}
void on_step_out_activate(GtkWidget *win)
{
- debug_cpu_single_step_out(get_running_machine(win));
+ debug_cpu_get_visible_cpu(get_running_machine(win))->debug()->single_step_out();
}
void on_hard_reset_activate(GtkWidget *win)
@@ -897,7 +897,7 @@ void on_hard_reset_activate(GtkWidget *win)
void on_soft_reset_activate(GtkWidget *win)
{
get_running_machine(win)->schedule_soft_reset();
- debug_cpu_go(get_running_machine(win), ~0);
+ debug_cpu_get_visible_cpu(get_running_machine(win))->debug()->go();
}
void on_exit_activate(GtkWidget *win)
@@ -1010,7 +1010,7 @@ on_set_breakpoint_at_cursor_activate(GtkWidget *win)
if (debug_cpu_get_visible_cpu(info->machine) == disasm->view->source()->device())
{
offs_t address = downcast<debug_view_disasm *>(disasm->view)->selected_address();
- cpu_debug_data *cpuinfo = cpu_get_debug_data(disasm->view->source()->device());
+ device_debug *cpuinfo = disasm->view->source()->device()->debug();
debug_cpu_breakpoint *bp;
INT32 bpindex = -1;
diff --git a/src/osd/windows/debugwin.c b/src/osd/windows/debugwin.c
index de0482a2532..7e15e47e2c7 100644
--- a/src/osd/windows/debugwin.c
+++ b/src/osd/windows/debugwin.c
@@ -514,7 +514,7 @@ void debugwin_update_during_game(running_machine *machine)
HWND focuswnd = GetFocus();
debugwin_info *info;
- debug_cpu_halt_on_next_instruction(debug_cpu_get_visible_cpu(machine), "User-initiated break\n");
+ debug_cpu_get_visible_cpu(machine)->debug()->halt_on_next_instruction("User-initiated break\n");
// if we were focused on some window's edit box, reset it to default
for (info = window_list; info != NULL; info = info->next)
@@ -795,7 +795,7 @@ static LRESULT CALLBACK debugwin_window_proc(HWND wnd, UINT message, WPARAM wpar
if (main_console && main_console->wnd == wnd)
{
smart_show_all(FALSE);
- debug_cpu_go(info->machine, ~0);
+ debug_cpu_get_visible_cpu(info->machine)->debug()->go();
}
else
DestroyWindow(wnd);
@@ -2251,14 +2251,14 @@ static int disasm_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lpar
if (dasmview->cursor_visible() && debug_cpu_get_visible_cpu(info->machine) == dasmview->source()->device())
{
offs_t address = dasmview->selected_address();
- cpu_debug_data *cpuinfo = cpu_get_debug_data(dasmview->source()->device());
+ device_debug *debug = dasmview->source()->device()->debug();
INT32 bpindex = -1;
/* first find an existing breakpoint at this address */
- for (debug_cpu_breakpoint *bp = cpuinfo->bplist; bp != NULL; bp = bp->next)
- if (address == bp->address)
+ for (debug_cpu_breakpoint *bp = debug->breakpoint_first(); bp != NULL; bp = bp->next())
+ if (address == bp->address())
{
- bpindex = bp->index;
+ bpindex = bp->index();
break;
}
@@ -2533,7 +2533,7 @@ static void console_process_string(debugwin_info *info, const char *string)
// an empty string is a single step
if (string[0] == 0)
- debug_cpu_single_step(info->machine, 1);
+ debug_cpu_get_visible_cpu(info->machine)->debug()->single_step();
// otherwise, just process the command
else
@@ -2638,31 +2638,31 @@ static int global_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lpar
case ID_RUN_AND_HIDE:
smart_show_all(FALSE);
case ID_RUN:
- debug_cpu_go(info->machine, ~0);
+ debug_cpu_get_visible_cpu(info->machine)->debug()->go();
return 1;
case ID_NEXT_CPU:
- debug_cpu_next_cpu(info->machine);
+ debug_cpu_get_visible_cpu(info->machine)->debug()->go_next_device();
return 1;
case ID_RUN_VBLANK:
- debug_cpu_go_vblank(info->machine);
+ debug_cpu_get_visible_cpu(info->machine)->debug()->go_vblank();
return 1;
case ID_RUN_IRQ:
- debug_cpu_go_interrupt(info->machine, -1);
+ debug_cpu_get_visible_cpu(info->machine)->debug()->go_interrupt();
return 1;
case ID_STEP:
- debug_cpu_single_step(info->machine, 1);
+ debug_cpu_get_visible_cpu(info->machine)->debug()->single_step();
return 1;
case ID_STEP_OVER:
- debug_cpu_single_step_over(info->machine, 1);
+ debug_cpu_get_visible_cpu(info->machine)->debug()->single_step_over();
return 1;
case ID_STEP_OUT:
- debug_cpu_single_step_out(info->machine);
+ debug_cpu_get_visible_cpu(info->machine)->debug()->single_step_out();
return 1;
case ID_HARD_RESET:
@@ -2671,7 +2671,7 @@ static int global_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lpar
case ID_SOFT_RESET:
info->machine->schedule_soft_reset();
- debug_cpu_go(info->machine, ~0);
+ debug_cpu_get_visible_cpu(info->machine)->debug()->go();
return 1;
case ID_EXIT: