How set MAME breakpoint from GDB?
Posted: Sun Aug 07, 2016 7:30 pm
When debugging problems with a machine (say SNES), I set various breakpoints in gdb (debugging mame.exe).
Often, I'd like to also set a breakpoint for the emulated SNES depending on watchpoints I see in the gdb-debugged mame.exe, not by pressing "continue" in gdb and waiting for the internal MAME debugging console to come back up, but immediately.
I've tried various variants of this line:
(g_machine->firstcpu->debug())->breakpoint_set(0x1234, "", "")
But the best I can get it a sigsegv
I generally inspect the emulated program counter with g_machine->firstcpu->pc, which seems to work on every line I've cared to break.
Just in case, I added __attribute__((optimize("O0"), noinline, used) to the definition of breakpoint_set.
Often, I'd like to also set a breakpoint for the emulated SNES depending on watchpoints I see in the gdb-debugged mame.exe, not by pressing "continue" in gdb and waiting for the internal MAME debugging console to come back up, but immediately.
I've tried various variants of this line:
(g_machine->firstcpu->debug())->breakpoint_set(0x1234, "", "")
But the best I can get it a sigsegv
I generally inspect the emulated program counter with g_machine->firstcpu->pc, which seems to work on every line I've cared to break.
Just in case, I added __attribute__((optimize("O0"), noinline, used) to the definition of breakpoint_set.