Re: GDB will set bp at a function for RISC-V when step over this function call

Jim Wilson <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAFyWVaa5U0cMdezJVa-qQ7xe4-r10zHcWEPc-qWFvQ9L1BAumQ@mail.gmail.com>
On Mon, Sep 20, 2021 at 10:06 AM John Baldwin <[email protected]> wrote:

> RISC-V doesn't (to my knowledge) have support for hardware single step and
> should be using software single step on bare metal as well.
>

There is hardware single-step/breakpoint/watchpoint support.  However, in
old versions of the debug spec (e.g. HiFive Unleashed), this support was
only visible via jtag, and hence unusable to linux/freebsd/etc.  But
openocd does have hardware single-step/breakpoint/watchport support which
does work.  People doing bare metal debugging are expected to use openocd
with gdb.  In new versions of the debug spec (e.g. HiFive Unmatched), this
support is now visible in machine mode, but we need opensbi and kernel
support before gdb can use it.  I don't know of anyone working on that,
though I might try it if I ever find the time.

Jim
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.