From: Pedro Alves <palves@redhat.com>
To: "Maciej W. Rozycki" <macro@imgtec.com>
Cc: gdb-patches@sourceware.org, "Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: [PATCH] Handle MIPS Linux SIGTRAP siginfo.si_code values
Date: Wed, 24 Feb 2016 23:20:00 -0000 [thread overview]
Message-ID: <56CE3AA6.6090005@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1602242025100.15885@tp.orcam.me.uk>
On 02/24/2016 08:39 PM, Maciej W. Rozycki wrote:
> Whereas for real breakpoint hits if we report TRAP_BRKPT for software
> breakpoints and TRAP_HWBKPT for hardware data or instruction breakpoints
> (the latters once implemented), then the:
>
> if (GDB_ARCH_IS_TRAP_BRKPT (siginfo.si_code)
> && GDB_ARCH_IS_TRAP_HWBKPT (siginfo.si_code))
>
> condition will never be true for legitimate SIGTRAP events and the slow
> path won't trigger. But then the MIPS variant will need:
>
> # define GDB_ARCH_IS_TRAP_BRKPT(X) ((X) == SI_KERNEL || (X) == TRAP_BRKPT)
> # define GDB_ARCH_IS_TRAP_HWBKPT(X) ((X) == SI_KERNEL || (X) == TRAP_HWBKPT)
Exactly.
>
> to actually recognise these events at all in the first place. So we
> better have it right away or updated kernels will break GDB for a change.
OK, if you're still willing to change the kernel, let's do it.
I had somehow imagined (and reading back, I have no idea why) that you
_didn't_ want to change the si_code, if possible, and was going by that.
(There's always risk associated with such a change, as it's effectively
an ABI break and some tool out there may be relying on SI_KERNEL and may
thus stop working correctly. Usually ABI stability trumps "cleanliness",
in kernel circles.)
> But you haven't put it in your proposal despite my earlier suggestion,
> hence my question whether you want this kernel API correction and the
> resulting optimisation or not (I do).
I was just keeping matters separate, by keeping the patch strictly
about fixing the regression with existing kernels.
> Given my observations above it looks to me that we only really need the
> two macros updated with my proposal on the GDB side and a corresponding
> rather trivial kernel update to have the codes set in the first place, and
> we can get away without complicating code with an extra run-time probe.
>
> Have I missed anything?
I think not.
I've just finished testing it on s390 -- no regressions. I've
pushed it in now, as is. I'll follow up with a new patch that makes
gdb accept the anticipated new si_codes too.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2016-02-24 23:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-24 16:44 Pedro Alves
2016-02-24 18:29 ` Maciej W. Rozycki
2016-02-24 18:51 ` Pedro Alves
2016-02-24 19:02 ` Luis Machado
2016-02-24 20:49 ` Maciej W. Rozycki
2016-02-24 21:10 ` Luis Machado
2016-02-24 20:39 ` Maciej W. Rozycki
2016-02-24 23:20 ` Pedro Alves [this message]
2016-02-24 23:37 ` [PATCH] MIPS/Linux: Also recognize TRAP_BRKPT and TRAP_HWBKPT Pedro Alves
2016-02-25 1:39 ` [PATCH] Handle MIPS Linux SIGTRAP siginfo.si_code values Maciej W. Rozycki
2016-02-25 1:45 ` Pedro Alves
2016-04-05 16:57 ` Maciej W. Rozycki
2016-04-15 23:17 ` Pedro Alves
2016-02-24 18:51 ` Luis Machado
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=56CE3AA6.6090005@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=macro@imgtec.com \
--cc=macro@linux-mips.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).