diff options
author | Himbeer <himbeer@disroot.org> | 2024-05-14 12:38:49 +0200 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-05-14 12:38:49 +0200 |
commit | 2e3fd0a7719b06c72ab1ab8b1e1bbf36125072f5 (patch) | |
tree | dc50da6179f47d2dc6057580ccf2af08b5141ee6 | |
parent | 41f2c18185484c5e4d3c28d869cd40eaba0ca37f (diff) |
doc: Add section on debugging with gdb
-rw-r--r-- | README.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -182,3 +182,15 @@ The advantage of this boot flow is that it doesn't require the use of U-Boot. In theory, anything that sets the registers as described above and runs the kernel in S-mode should work, so any SBI should work if you can get it to run. + +# Debugging + +You can run QEMU with the `-s -S` flags and attach `riscv64-elf-gdb`: + +``` +add-symbol-file /path/to/srvre_kernel.elf +target remote localhost:1234 +``` + +Be sure to confirm the prompt from the `add-symbol-file` command. +You can also use `riscv64-elf-gdb /path/to/srvre_kernel.elf` directly. |