diff options
author | 2015-02-21 23:40:57 +1100 | |
---|---|---|
committer | 2015-02-22 01:19:09 +1100 | |
commit | b5afc9dfea42f3c7f361fb2006c9b3df2bc41b00 (patch) | |
tree | 5dcb953e64147fdaf914b7d9d87d24fe8f8283bc | |
parent | 22cb10b42c3fcf5b702abed94d1bd64934791771 (diff) |
More debugger consistency
-rw-r--r-- | src/osd/modules/debugger/osx/debugconsole.m | 8 | ||||
-rw-r--r-- | src/osd/modules/debugger/qt/dasmwindow.c | 51 |
2 files changed, 16 insertions, 43 deletions
diff --git a/src/osd/modules/debugger/osx/debugconsole.m b/src/osd/modules/debugger/osx/debugconsole.m index 130699b0ab5..1028e718642 100644 --- a/src/osd/modules/debugger/osx/debugconsole.m +++ b/src/osd/modules/debugger/osx/debugconsole.m @@ -240,9 +240,9 @@ // if it doesn't exist, add a new one NSString *command; if (bp == NULL) - command = [NSString stringWithFormat:@"bpset %lX", (unsigned long)address]; + command = [NSString stringWithFormat:@"bpset 0x%lX", (unsigned long)address]; else - command = [NSString stringWithFormat:@"bpclear %X", (unsigned)bp->index()]; + command = [NSString stringWithFormat:@"bpclear 0x%X", (unsigned)bp->index()]; debug_console_execute_command(*machine, [command UTF8String], 1); } } @@ -258,9 +258,9 @@ { NSString *command; if (bp->enabled()) - command = [NSString stringWithFormat:@"bpdisable %X", (unsigned)bp->index()]; + command = [NSString stringWithFormat:@"bpdisable 0x%X", (unsigned)bp->index()]; else - command = [NSString stringWithFormat:@"bpenable %X", (unsigned)bp->index()]; + command = [NSString stringWithFormat:@"bpenable 0x%X", (unsigned)bp->index()]; debug_console_execute_command(*machine, [command UTF8String], 1); } } diff --git a/src/osd/modules/debugger/qt/dasmwindow.c b/src/osd/modules/debugger/qt/dasmwindow.c index df171952052..4761af02195 100644 --- a/src/osd/modules/debugger/qt/dasmwindow.c +++ b/src/osd/modules/debugger/qt/dasmwindow.c @@ -128,9 +128,9 @@ void DasmWindow::toggleBreakpointAtCursor(bool changedTo) { if (m_dasmView->view()->cursor_visible()) { - offs_t address = downcast<debug_view_disasm *>(m_dasmView->view())->selected_address(); - device_t *device = m_dasmView->view()->source()->device(); - device_debug *cpuinfo = device->debug(); + offs_t const address = downcast<debug_view_disasm *>(m_dasmView->view())->selected_address(); + device_t *const device = m_dasmView->view()->source()->device(); + device_debug *const cpuinfo = device->debug(); // Find an existing breakpoint at this address INT32 bpindex = -1; @@ -146,34 +146,18 @@ void DasmWindow::toggleBreakpointAtCursor(bool changedTo) } // If none exists, add a new one - if (debug_cpu_get_visible_cpu(*m_machine) == device) + if (bpindex == -1) { - astring command; - if (bpindex == -1) - { - command.printf("bpset 0x%X", address); - } - else - { - command.printf("bpclear 0x%X", bpindex); - } - debug_console_execute_command(*m_machine, command, 1); + bpindex = cpuinfo->breakpoint_set(address, NULL, NULL); + debug_console_printf(*m_machine, "Breakpoint %X set\n", bpindex); } else { - if (bpindex == -1) - { - bpindex = cpuinfo->breakpoint_set(address, NULL, NULL); - debug_console_printf(*m_machine, "Breakpoint %X set\n", bpindex); - } - else - { - cpuinfo->breakpoint_clear(bpindex); - debug_console_printf(*m_machine, "Breakpoint %X cleared\n", bpindex); - } - m_machine->debug_view().update_all(); - debugger_refresh_display(*m_machine); + cpuinfo->breakpoint_clear(bpindex); + debug_console_printf(*m_machine, "Breakpoint %X cleared\n", bpindex); } + m_machine->debug_view().update_all(); + debugger_refresh_display(*m_machine); } refreshAll(); @@ -184,19 +168,8 @@ void DasmWindow::runToCursor(bool changedTo) { if (m_dasmView->view()->cursor_visible()) { - offs_t address = downcast<debug_view_disasm*>(m_dasmView->view())->selected_address(); - device_t *device = m_dasmView->view()->source()->device(); - - if (debug_cpu_get_visible_cpu(*m_machine) == device) - { - astring command; - command.printf("go 0x%X", address); - debug_console_execute_command(*m_machine, command, 1); - } - else - { - device->debug()->go(address); - } + offs_t const address = downcast<debug_view_disasm*>(m_dasmView->view())->selected_address(); + m_dasmView->view()->source()->device()->debug()->go(address); } } |