public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Lancelot SIX <lsix@lancelotsix.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb.base/sigstep.exp: Mark xfail on unsupported scenarios on riscv64-linux-gnu
Date: Mon, 5 Jul 2021 17:23:37 +0000	[thread overview]
Message-ID: <20210705172337.a6obk2hpc6gvfw4j@ubuntu.lan> (raw)
In-Reply-To: <20210705083908.GD2568@embecosm.com>

On Mon, Jul 05, 2021 at 09:39:08AM +0100, Andrew Burgess wrote:
> 
> I wonder if, rather than hard coding the xfail to check for RISC-V, we
> could add a helper function to lib/gdb.exp like:
> 
>   proc uses_software_single_step_p {} {
>     ...
>   }
> 
> which would return true/false indicating if the current target uses
> software single stepping?
> 
> We might want to use this test in other places later, and if there are
> other targets that also have this issue it is then super easy for them
> to add their architecture into this new proc.
> 
> However, rather than have the new proc check a list of architectures,
> we could possible make it do something like this:
> 
>   (gdb) pipe maintenance print architecture | grep gdbarch_software_single_step_p
>   gdbarch_dump: gdbarch_software_single_step_p() = 0
> 
> The above was run on x86-64 which doesn't use software single step,
> but I believe on RISC-V/Linux the above should look like this:
> 
>   (gdb) pipe maintenance print architecture | grep gdbarch_software_single_step_p
>   gdbarch_dump: gdbarch_software_single_step_p() = 1

Hi

Yes, it does!

> 
> This would then automatically catch any target that use software
> single stepping.
> 
> What do you think?
> 
> Thanks,
> Andrew
> 

Your option is nice, but as Pedro pointed out in a later email there is
already a proc can_single_step_to_signal_handler that I somehow missed.
For the context of this particular patch, I think I’ll go with it.

That being said, I kinda prefer your approach that should be equivalent
(I guess) and avoid the hard written list of unsupported host targets.
I’ll add this to my TODO list.

Lancelot.

  reply	other threads:[~2021-07-05 17:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-04 17:00 Lancelot SIX
2021-07-05  8:39 ` Andrew Burgess
2021-07-05 17:23   ` Lancelot SIX [this message]
2021-07-05 10:26 ` Pedro Alves
2021-07-05 17:32   ` Lancelot SIX

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=20210705172337.a6obk2hpc6gvfw4j@ubuntu.lan \
    --to=lsix@lancelotsix.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).