Skip to content

GDB Debugging feature#706

Open
Ryan-Myers wants to merge 6 commits intoDavidSM64:masterfrom
Ryan-Myers:gdb_debug
Open

GDB Debugging feature#706
Ryan-Myers wants to merge 6 commits intoDavidSM64:masterfrom
Ryan-Myers:gdb_debug

Conversation

@Ryan-Myers
Copy link
Collaborator

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

…f, and remove CopyRom as it's not really needed.
…moved mdebug from the custom ld as it causes recent GDB versions to outright crash, and they're only generated by IDO, which we can't debug anyways. Also, I fixed the header calculation for how much code to load.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant