mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-07-05 12:39:47 +00:00
docs: debugging OpenSBI
Describe how to debug OpenSBI on QEMU with GDB. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
parent
54d7def6c2
commit
d9ba6536d3
1 changed files with 24 additions and 0 deletions
|
@ -147,3 +147,27 @@ qemu-system-riscv32 -M virt -m 256M -nographic \
|
||||||
-device virtio-blk-device,drive=hd0 \
|
-device virtio-blk-device,drive=hd0 \
|
||||||
-append "root=/dev/vda rw console=ttyS0"
|
-append "root=/dev/vda rw console=ttyS0"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Debugging with GDB
|
||||||
|
------------------
|
||||||
|
|
||||||
|
In a first console start OpenSBI with QEMU:
|
||||||
|
|
||||||
|
```
|
||||||
|
qemu-system-riscv64 -M virt -m 256M -nographic \
|
||||||
|
-bios build/platform/generic/firmware/fw_payload.bin \
|
||||||
|
-gdb tcp::1234 \
|
||||||
|
-S
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Parameter *-gdb tcp::1234* specifies 1234 as the debug port.
|
||||||
|
Parameter *-S* lets QEMU wait at the first instruction.
|
||||||
|
|
||||||
|
In a second console start GDB:
|
||||||
|
|
||||||
|
```
|
||||||
|
gdb build/platform/generic/firmware/fw_payload.elf \
|
||||||
|
-ex 'target remote localhost:1234'
|
||||||
|
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue