-
Notifications
You must be signed in to change notification settings - Fork 112
Run emulator as gdbserver #22
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
Comments
WIP: mini-gdbstub |
An experimental solution to this issue is created on my local branch now, which lets rv32emu support a small set of GDB Remote Serial Protocol packet with my mini-gdbstub library. Here's a small example to play with the debug mode, which shows the convenience to set a breakpoint to stop the emulator by a function symbol. rv32emu:
GDB:
A small concern here is that mini-gdbstub is still a WIP and unstable library, so it's not very convenient to use it as a submodule since we may have to sync the library frequently. I'm still thinking if that's a good idea to develop the part of gdbserver as another project. But I think mini-gdbstub is about to be integrated to rv32emu soon. NOTE: There are still many features and possible bugs that must be refined in mini-gdbstub, and rv32emu also have to provide a better implementation of the gdbstub abstraction (For example, |
Both git submodule and in-repository maintenance are fine to me. Pick one when you are ready to submit pull request(s). |
See also |
With the help of the external mini-gdbstub library, rv32emu offers an experimental way to support a limited number of GDB Remote Serial Protocol (GDBRSP) packets. After applying this patch, we were able to connect rv32emu to GDB and interact with it using basic commands such as "print $pc" to dump the value of current program counter or "continue" to resume program running. It is important to note that this patch only permits the use of one breakpoint. Future upgrades will be made. Close sysprog21#22
rISA implements an interesting GDB mode, which runs the simulator as a gdbserver. That is, it allows us to connect RISC-V program with a remote GDB via
target remote
ortarget extended-remote
-- but without linking in the usual debugging stub. Hopefully,rv32emu
can follow the experimental feature in rISA to provide builtin gdbserver.See also:
The text was updated successfully, but these errors were encountered: