From: Anton Blanchard <antonb@tenstorrent.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org, npiggin@gmail.com
Subject: Re: [EXT] Re: [PATCH] RISC-V: Use hardware single step when available
Date: Tue, 22 Sep 2026 11:26:54 +1000 [thread overview]
Message-ID: <CAN7m+mBWDaPzY3R4_C9Qkxb9Dzbk5Se=d4PC+ORsj1f+HOphAQ@mail.gmail.com> (raw)
In-Reply-To: <87tsnputjs.fsf@tromey.com>
Hi Tom,
On Thu, Sep 17, 2026 at 1:04 AM Tom Tromey <tom@tromey.com> wrote:
>
> >>>>> "Anton" == Anton Blanchard <antonb@tenstorrent.com> writes:
>
> Anton> If the target supports hardware single-stepping use it instead of
> Anton> inserting software breakpoints. We continue to use software breakpoints
> Anton> for stepping over LR/SC atomic sequences.
>
> I'm definitely not the person to review RISC-V bugs.
>
> That said, I'm curious about two things.
>
> First, if the target advertises that it can single-step, should that
> include stepping over atomic sequences? IOW could this also be deferred
> to, say, gdbserver to handle properly?
The problem is that we have multiple types of targets that support
hardware single-stepping. Simulators (eg QEMU) can single-step through
an lr/sc sequence, but in-band single stepping (eg via ptrace) and
some hardware debuggers cannot because the reservation clears on an
exception. I chose the most conservative option (similar to ARM), but
Nick Piggin let me know about this patch where he exposes an option to
configure it:
https://sourceware.org/pipermail/gdb/2024-February/051080.html
He also suggested adding a qSupported flag to automatically configure
this, which QEMU can set.
Thanks,
Anton
> Second, I wonder why target_can_do_single_step isn't called at some
> higher level.
>
> Anyway I see that arm-linux-tdep.c -- but not arm-tdep.c,
> mysteriously -- does what you've done here. And I don't have any
> objection or anything, just questions.
>
> Tom
prev parent reply other threads:[~2026-09-22 1:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 0:28 Anton Blanchard
2026-09-16 15:04 ` Tom Tromey
2026-09-22 1:26 ` Anton Blanchard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAN7m+mBWDaPzY3R4_C9Qkxb9Dzbk5Se=d4PC+ORsj1f+HOphAQ@mail.gmail.com' \
--to=antonb@tenstorrent.com \
--cc=gdb-patches@sourceware.org \
--cc=npiggin@gmail.com \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox