mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-05 14:33:40 +00:00
This is used in host-gdbstub to enable the functionality. This allows the stackoverflow test to continue working. Meter test modified to handle new evt type. |
||
|---|---|---|
| .. | ||
| gdbstub.h | ||
| host-gdbstub.c | ||
| Makefile | ||
| README.md | ||
Why?
To debug your guest application. GDB can attach to the host over TCP socket, stdio,
serial connection, etc. In the provided example, it communicate over stdio, however
using socat it can be redirected to a TCP socket.
How to use it
-
Compile a guest application, for example from apps directory. To have a better debugging experience, use
-O0and-g3. -
Run the host prividing the app binary file. Use the following command to redirect stdio to a TCP socket:
socat -v -x
TCP-LISTEN:1234,reuseaddr \
EXEC:"./host-gdbstub ../../apps/maze/maze.bin"
-v and -x are used to see the traffic in hex.
- Fire up a
riscv32-elf-gdb(might be different name on your OS) and give it the generated elf file from step 1:
riscv32-elf-gdb -ex 'target remote :1234' -ex 'layout src' maze.elf
- Happy debugging.
s,si,n, breakpoint, etc should be working :)