# 02 — risc-v-gsp-rm-debugger usage > **# TOOL IN DEVELOPMENT - NOT READY YET!** See 00 for status. All commands are run from `open-iov/debug/risc-v-gsp-rm-vm/`. ## 0. Requirements * `qemu-system-riscv64` (Ubuntu: `apt install qemu-system-misc`); * Python 3.10+ (stdlib only); * for the demo firmware: `clang` and `lld` (`apt install lld-18` provides `/usr/lib/llvm-18/bin/ld.lld`). Check everything: ```bash ./risc-v-gsp-rm-debugger.sh info make test # builds the demo then runs unit + QEMU smoke tests ``` ## 1. The canned demo (fastest way to see it work) ```bash make demo ./risc-v-gsp-rm-debugger.sh demo ``` It boots `firmware/uproc_demo/build/uproc_demo.elf`, installs hooks on all `rpc_*` handlers and a watchpoint on `rpc_count`, runs the firmware self-test, injects a `PING` from the host, decodes and diffs the control block, then injects `FAULT` to capture the `ebreak` trap. A session is recorded under `dumps/` and a `summary.md` is written. Options: `--no-build`, `--duration SECONDS`, `--kernel PATH`, `--record PATH`. ## 2. Interactive REPL ```bash ./risc-v-gsp-rm-debugger.sh attach --kernel firmware/uproc_demo/build/uproc_demo.elf ``` `attach` launches the target itself when `--port` is omitted. To share a target between terminals, launch it separately and attach by port: ```bash ./risc-v-gsp-rm-debugger.sh launch --kernel # prints: gdbstub: 127.0.0.1: ./risc-v-gsp-rm-debugger.sh attach --port --kernel ``` REPL commands: | Command | Meaning | |---|---| | `regs` / `reg [value]` | read/write registers | | `x [len]` | annotated hexdump | | `mem ` | raw bytes (hex) | | `w ` / `wstr ` | write memory | | `bp [sw\|hw]` | breakpoint that prints on hit | | `hook ` | enter/leave hook with printing | | `watch [size] [w\|r\|a]` | watchpoint | | `s [n]` / `c [seconds]` | step n; continue for N seconds | | `snap