n64dev / cen64

Cycle-Accurate Nintendo 64 Emulator
BSD 3-Clause "New" or "Revised" License
803 stars 70 forks source link

Implement gdb #187

Closed lambertjamesd closed 3 years ago

lambertjamesd commented 3 years ago

This PR aims to implement a remote debugger into cen64 https://github.com/n64dev/cen64/issues/87

It first implements breakpoint handling into the core cen64 device, independent of this specific gdb implementation. This will allow the option for other debuggers in the future.

I then implement the gdb protocol on top of the cen64 device. To use it, you just need to use the already present but unused -debug flag

cen64 -debug localhost:2345 pifdata.bin rom.n64

This will open the cen64 window but will not run the rom until a debugger has been connected. A temporary breakpoint is automatically set at address 0x80000000


gdb-multiarch -q game.out
Reading symbols from game.out...
(gdb) target remote localhost:2345
Remote debugging using localhost:2345
0x80000000 in ?? ()
(gdb) 
> 
mikeryan commented 3 years ago

I regret that I only have one 🎉 to give

tj90241 commented 3 years ago

What he said! ^