uvm32/hosts/host-gdbstub
Toby Jaffey a72737b228 Add uvm32_useBreak(uvmst, bool) function to enable ebreak handling.
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.
2026-04-16 10:51:08 +01:00
..
gdbstub.h Add an example host to demonstrate gdbstub 2026-04-15 22:41:54 +01:00
host-gdbstub.c Add uvm32_useBreak(uvmst, bool) function to enable ebreak handling. 2026-04-16 10:51:08 +01:00
Makefile Add an example host to demonstrate gdbstub 2026-04-15 22:41:54 +01:00
README.md Add an example host to demonstrate gdbstub 2026-04-15 22:41:54 +01:00

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

  1. Compile a guest application, for example from apps directory. To have a better debugging experience, use -O0 and -g3.

  2. 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.

  1. 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

  1. Happy debugging. s, si, n, breakpoint, etc should be working :)