diff options
| author | Heinrich Schuchardt <[email protected]> | 2021-05-28 18:22:14 +0200 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2021-06-02 17:04:07 +0530 |
| commit | d9ba6536d307f05a838e7c96cd20b0b7e43ec886 (patch) | |
| tree | 25cab7b9d7ed024d31c1afcbea8cdc6550972711 /docs | |
| parent | 54d7def6c254058f9458a0e26205b3c93a48bb42 (diff) | |
docs: debugging OpenSBI
Describe how to debug OpenSBI on QEMU with GDB.
Signed-off-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/platform/qemu_virt.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/platform/qemu_virt.md b/docs/platform/qemu_virt.md index 27771485..0783be4a 100644 --- a/docs/platform/qemu_virt.md +++ b/docs/platform/qemu_virt.md @@ -147,3 +147,27 @@ qemu-system-riscv32 -M virt -m 256M -nographic \ -device virtio-blk-device,drive=hd0 \ -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' + +``` |
