From: Joel Brobecker <brobecker@adacore.com>
To: Jan Vrany <jan.vrany@labware.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
Joel Brobecker <brobecker@adacore.com>
Subject: Re: [PATCH v2 1/2] ppc: use 'trap' ('tw, 31, 0, 0', 0x7fe00008) as breakpoint instruction
Date: Wed, 1 Dec 2021 13:23:57 +0400 [thread overview]
Message-ID: <Yac/LRqrnVCwqQB1@adacore.com> (raw)
In-Reply-To: <08be85df9760d969375f31febb1df71c0936384e.camel@labware.com>
Hi Jan,
> > > typedef BP_MANIPULATION_ENDIAN (little_breakpoint, big_breakpoint)
> > > rs6000_breakpoint;
> >
> > I'm going to say OK, but I'd like to know what your source is
> > for this, so we can document that change. Part of me wonders
> > why we're making a change like this one on some code which
> > works, which is always a risk, no matter how small, unless we have
> > enough evidence that this is going to be helpful in practice.
>
> According to Power ISA 3.0 B spec [1], section 3.3.11 Fixed-Point Trap
> Instructions (also section C.6 Trap Mnemonics), unconditional trap
> is encoded as `tw 31, 0, 0`. While debugging a problem on POWER
> (gdb not stopping on a `trap` instruction) I found that GDB is using
> `tdnl r2, r2` (trap if not less than) which works but it is different
> than unconditional trap as specified. I could not find out why
> `tdnl` was used instead of unconditional `trap`. I thought it is
> more "natural" to use canonical unconditional trap. So this is merely
> a "cosmetic" change.
>
> I agree that I should have included reference to the spec in the
> commit message and maybe also add comment to the code. Will do in
> next version (should we decide to keep this patch).
>
> Now, I do understand the risk of changing something that works. I'm
> happy to drop this patch since the next one in this miniseries
> fixes the problem we were experiencing properly (that is, GDB not
> stopping on software-planted breakpoint instructions).
>
> What do you think?
With the addition of the reference in the commit message, I'd say
let's make the change. I don't think the risk is very high, and
I don't want an issue that's most likely non-existant to cause
enough FUD that we'd ignore a patch that looks correct.
Worse case scenario, we revert!
--
Joel
next prev parent reply other threads:[~2021-12-01 9:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 15:42 [PATCH " Jan Vrany
2021-11-23 15:42 ` [PATCH 2/2] ppc: recognize all program traps Jan Vrany
2021-11-24 10:43 ` Lancelot SIX
2021-11-24 10:57 ` Lancelot SIX
2021-11-24 13:09 ` [PATCH v2 0/2] " Jan Vrany
2021-11-24 13:09 ` [PATCH v2 1/2] ppc: use 'trap' ('tw, 31, 0, 0', 0x7fe00008) as breakpoint instruction Jan Vrany
2021-11-27 6:45 ` Joel Brobecker
2021-11-29 11:50 ` Jan Vrany
2021-12-01 9:23 ` Joel Brobecker [this message]
2021-11-24 13:09 ` [PATCH v2 2/2] ppc: recognize all program traps Jan Vrany
2021-11-27 6:58 ` Joel Brobecker
2021-11-30 12:17 ` Pedro Alves
2021-12-01 13:52 ` Jan Vrany
2021-12-01 14:30 ` [PATCH v3 0/2] " Jan Vrany
2021-12-01 14:30 ` [PATCH v3 1/2] ppc: use "trap" ("tw, 31, 0, 0") as breakpoint instruction Jan Vrany
2021-12-04 10:16 ` Joel Brobecker
2021-12-01 14:30 ` [PATCH v3 2/2] ppc: recognize all program traps Jan Vrany
2021-12-04 10:18 ` Joel Brobecker
2021-12-07 23:30 ` Pedro Alves
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=Yac/LRqrnVCwqQB1@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.vrany@labware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).