Tafoid wrote:Unfortunately, I don't know of any Developers that use GDB for that purpose. The built-in debugger should be able to accomplish all you need, I presume.
No, you misunderstand; I'm using gdb to debug the emulator itself (the x86 binary) to track down bugs in the emulation.
But I'm also using the build-in debugger at the same time, for instance to trigger certain behavior in the emulated system (let's say a write to emulated video memory) that will trigger bugs in the emulator (let's say a buffer pointer for the SDL renderrer that was accidentally overwritten).
So I run, from the command line:
Code: Select all
gdb mame.exe --args mame.exe -debug
Then I set a breakpoint in mame.exe like
break write_memory
When gdb stops at the write_memory function, I say let's say that the emulated system's program counter is 0x1234, and I realize I'd like the MAME debugger to break at 0x124a.
If I simply use continue in gdb, I won't have time to use the osd debugger interface to type in bp 1234, because the emulator is running at full speed and will skip past 0x124a immediately. Simply setting a breakpoint before whatever emulated code is causing write_memory to be called is not an option, if the system is large and you don't already have the problem narrowed down. In any case, it is not what I'm asking for; I want to set a MAME debugger breakpoint while mame.exe is stopped in gdb.
How can I set that breakpoint for the emulated system, from within gdb by calling the debugger interface code?