mirror of
https://github.com/holub/mame
synced 2025-06-26 14:24:12 +03:00
More debugger consistency
This commit is contained in:
parent
22cb10b42c
commit
b5afc9dfea
@ -240,9 +240,9 @@
|
|||||||
// if it doesn't exist, add a new one
|
// if it doesn't exist, add a new one
|
||||||
NSString *command;
|
NSString *command;
|
||||||
if (bp == NULL)
|
if (bp == NULL)
|
||||||
command = [NSString stringWithFormat:@"bpset %lX", (unsigned long)address];
|
command = [NSString stringWithFormat:@"bpset 0x%lX", (unsigned long)address];
|
||||||
else
|
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);
|
debug_console_execute_command(*machine, [command UTF8String], 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -258,9 +258,9 @@
|
|||||||
{
|
{
|
||||||
NSString *command;
|
NSString *command;
|
||||||
if (bp->enabled())
|
if (bp->enabled())
|
||||||
command = [NSString stringWithFormat:@"bpdisable %X", (unsigned)bp->index()];
|
command = [NSString stringWithFormat:@"bpdisable 0x%X", (unsigned)bp->index()];
|
||||||
else
|
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);
|
debug_console_execute_command(*machine, [command UTF8String], 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,9 +128,9 @@ void DasmWindow::toggleBreakpointAtCursor(bool changedTo)
|
|||||||
{
|
{
|
||||||
if (m_dasmView->view()->cursor_visible())
|
if (m_dasmView->view()->cursor_visible())
|
||||||
{
|
{
|
||||||
offs_t address = downcast<debug_view_disasm *>(m_dasmView->view())->selected_address();
|
offs_t const address = downcast<debug_view_disasm *>(m_dasmView->view())->selected_address();
|
||||||
device_t *device = m_dasmView->view()->source()->device();
|
device_t *const device = m_dasmView->view()->source()->device();
|
||||||
device_debug *cpuinfo = device->debug();
|
device_debug *const cpuinfo = device->debug();
|
||||||
|
|
||||||
// Find an existing breakpoint at this address
|
// Find an existing breakpoint at this address
|
||||||
INT32 bpindex = -1;
|
INT32 bpindex = -1;
|
||||||
@ -146,34 +146,18 @@ void DasmWindow::toggleBreakpointAtCursor(bool changedTo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If none exists, add a new one
|
// If none exists, add a new one
|
||||||
if (debug_cpu_get_visible_cpu(*m_machine) == device)
|
if (bpindex == -1)
|
||||||
{
|
{
|
||||||
astring command;
|
bpindex = cpuinfo->breakpoint_set(address, NULL, NULL);
|
||||||
if (bpindex == -1)
|
debug_console_printf(*m_machine, "Breakpoint %X set\n", bpindex);
|
||||||
{
|
|
||||||
command.printf("bpset 0x%X", address);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
command.printf("bpclear 0x%X", bpindex);
|
|
||||||
}
|
|
||||||
debug_console_execute_command(*m_machine, command, 1);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (bpindex == -1)
|
cpuinfo->breakpoint_clear(bpindex);
|
||||||
{
|
debug_console_printf(*m_machine, "Breakpoint %X cleared\n", bpindex);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
m_machine->debug_view().update_all();
|
||||||
|
debugger_refresh_display(*m_machine);
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshAll();
|
refreshAll();
|
||||||
@ -184,19 +168,8 @@ void DasmWindow::runToCursor(bool changedTo)
|
|||||||
{
|
{
|
||||||
if (m_dasmView->view()->cursor_visible())
|
if (m_dasmView->view()->cursor_visible())
|
||||||
{
|
{
|
||||||
offs_t address = downcast<debug_view_disasm*>(m_dasmView->view())->selected_address();
|
offs_t const address = downcast<debug_view_disasm*>(m_dasmView->view())->selected_address();
|
||||||
device_t *device = m_dasmView->view()->source()->device();
|
m_dasmView->view()->source()->device()->debug()->go(address);
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user