Diddy-Kong-Racing icon indicating copy to clipboard operation
Diddy-Kong-Racing copied to clipboard

GDB Debugging feature

Open Ryan-Myers opened this issue 7 months ago • 0 comments

So I managed to get DKR to work with GDB debugging in Ares. This is actually pretty cool. I haven't fully explored it, but it does work, and allows for some pretty cool debugging capabilities with breakpoints, variable inspections, stepping through the code line by line, and more. A screenshot from VS Code is below that shows how it can work.

The main changes here that I did was changing the mod ld file to keep all debugging sections instead of discarding them, I stole this from a project from Angelo's N64 stuff, so I haven't vetted if this is overkill or not, but it does seem to work.

I also needed to make some small changes to enable a new DEBUG=1 option for the makefile where I can compile the files with -O0, and -g, which seems to help with getting line numbers in the elf file, and making it easier to do single line stepping with gdb. There were issues with a handful of files that for some reason just don't work when compiled with -O0 but do work with -Os, so I had to devise a workaround for those files until we can figure out what's wrong.

image

Ryan-Myers avatar Sep 08 '25 16:09 Ryan-Myers