-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PoC gdbstub for debugging guest programs #107
Conversation
Worth taking a look at this: risc0/risc0#129 |
Found it, it requires this extension: https://marketplace.visualstudio.com/items?itemName=webfreak.debug |
A few other notes on getting this to work:
and use the path to this binary in the
|
Curious why this is a draft, should we aim to merge this? It's clearly useful. IMHO the only thing missing here is documentation. |
Yeah, documentation is missing but also because it's very basic support and not everything works perfectly. There are some issues with presenting local variables (I'm not sure if this is issue with the integration or vscode though - e.g. gdb itself prints variables nicely from when asked to with Also, it would be great to have an option to build guest programs with debug profile (currently release is hardcoded).
Debug info can be easily turned on with placing this in the [profile.release]
debug=true |
It didn't work at all. Every time I tried to step over, in, or out, it was the same as "continue." |
Add notes on RISC-V gdb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tweaked README a little, lgtm
A basic gdbstub that allows for debugging VM guest programs.
Example:
First, run the program with GDB on selected port:
It will spin up GDB server listening on port 9001 and halt the guest program before executing the first instruction. Note that the Rust VM host program is running, not stopped on any breakpoint etc.
Connect with gdb or IDE debugger:
GDB:
Vscode:
Edit launch.json configuration and add:
and start debugging with it.