More debugger consistency

This commit is contained in:
Vas Crabb 2015-02-21 23:40:57 +11:00
parent 22cb10b42c
commit b5afc9dfea
2 changed files with 16 additions and 43 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}