[PATCH 1/1] docs: debugging OpenSBI

Atish Patra atishp at atishpatra.org
Fri May 28 08:56:37 PDT 2021


On Fri, May 28, 2021 at 4:10 AM Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> Describe how to debug OpenSBI on QEMU with GDB.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
>  docs/platform/qemu_virt.md | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/docs/platform/qemu_virt.md b/docs/platform/qemu_virt.md
> index 2777148..de7a028 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-multiarch build/platform/generic/firmware/fw_payload.elf \
> +       -ex 'target remote localhost:1234'
> +
> +```
> --
> 2.32.0.rc0
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi


Reviewed-by: Atish Patra <atish.patra at wdc.com>

-- 
Regards,
Atish



More information about the opensbi mailing list