aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-05-14 12:38:49 +0200
committerHimbeer <himbeer@disroot.org>2024-05-14 12:38:49 +0200
commit2e3fd0a7719b06c72ab1ab8b1e1bbf36125072f5 (patch)
treedc50da6179f47d2dc6057580ccf2af08b5141ee6
parent41f2c18185484c5e4d3c28d869cd40eaba0ca37f (diff)
doc: Add section on debugging with gdb
-rw-r--r--README.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md
index c89f331..3900cd0 100644
--- a/README.md
+++ b/README.md
@@ -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.