Re: [PATCH] docs: platform: update qemu_virt.md

Anup Patel <[email protected]>
Newsgroups org.infradead.lists.opensbi
Message-ID <CAAhSdy3UBpnyiApALGUnMv7xTKGF1M-dwuXkkX_A-kRxCeSUwg@mail.gmail.com>
On Thu, Mar 19, 2026 at 6:28 PM <[email protected]> wrote:
>
> From: Zhang RunMin <[email protected]>
>
> When using GDB for debugging, if FW_TEXT_START is not set to 0x80000000
> during compilation, the following error occurs:
>
> Reading symbols from build/platform/generic/firmware/fw_payload.elf...
> Remote debugging using localhost:1234
> mips_warm_boot ()
>     at /home/zrmin/opensbi/platform/generic/mips/mips_warm_boot.S:11
> 11      j       _start_warm
> (gdb) b _start
> Breakpoint 1 at 0x0: file /home/zrmin/opensbi/firmware/fw_base.S, line 50.
> (gdb) c
> Continuing.
> Remote connection closed
> (gdb)
>
> With FW_TEXT_START=0x80000000, debugging works correctly:
> Reading symbols from build/platform/generic/firmware/fw_payload.elf...
> Remote debugging using localhost:1234
> 0x0000000000001000 in ?? ()
> (gdb) b _start
> Breakpoint 1 at 0x80000000: file /home/zrmin/opensbi/firmware/fw_base.S, line 50.
> (gdb) c
> Continuing.
>
> Breakpoint 1, _start () at /home/zrmin/opensbi/firmware/fw_base.S:50
> 50      MOV_3R  s0, a0, s1, a1, s2, a2
> (gdb)
>
> This is because QEMU loads OpenSBI at address 0x80000000. When
> FW_TEXT_START does not match this address, the debug symbols are
> incorrectly offset, causing GDB to fail to set breakpoints properly.
>
> Signed-off-by: Zhang RunMin <[email protected]>

LGTM.

Reviewed-by: Anup Patel <[email protected]>

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

> ---
>  docs/platform/qemu_virt.md | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/docs/platform/qemu_virt.md b/docs/platform/qemu_virt.md
> index fd87ee5a..4513df8b 100644
> --- a/docs/platform/qemu_virt.md
> +++ b/docs/platform/qemu_virt.md
> @@ -158,6 +158,9 @@ qemu-system-riscv32 -M virt -m 256M -nographic \
>  Debugging with GDB
>  ------------------
>
> +Note: the command line examples here assume that OpenSBI was compiled using
> +the `DEBUG=1 FW_TEXT_START=0x80000000` configuration.
> +
>  In a first console start OpenSBI with QEMU:
>
>  ```
> --
> 2.43.0
>
>
> --
> opensbi mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/opensbi

-- 
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.