From: Tom de Vries <tdevries@suse.de>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Subject: Re: [PATCH][gdb/tdep, rs6000] Don't skip system call in skip_prologue
Date: Tue, 2 Nov 2021 19:13:26 +0100 [thread overview]
Message-ID: <078020f9-9f2f-3c52-8625-ff426cb8536f@suse.de> (raw)
In-Reply-To: <79e1d5a7-1f41-9bb4-85b2-433c282a8254@simark.ca>
On 11/2/21 5:26 PM, Simon Marchi wrote:
> On 2021-11-02 7:33 a.m., Tom de Vries via Gdb-patches wrote:
>> Hi,
>>
>> I ran into a case where a breakpoint on _exit never triggered, because it was
>> set past the end of the _exit prologue, past the end of the exit_group system
>> call (which does not return).
>>
>> Fix this by treating system calls the same as branches in skip_prologue:
>> by default, don't skip.
>>
>> Tested on ppc64le-linux, on a power 8 machine.
>>
>> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28527
>>
>> Any comments?
>>
>> Thanks,
>> - Tom
>>
>> [gdb/tdep, rs6000] Don't skip system call in skip_prologue
>>
>> ---
>> gdb/rs6000-tdep.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
>> index 78b4fd1a913..4830ed22593 100644
>> --- a/gdb/rs6000-tdep.c
>> +++ b/gdb/rs6000-tdep.c
>> @@ -2137,6 +2137,12 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
>> /* Never skip branches. */
>> break;
>>
>> + /* Test based on opcode and mask values of
>> + powerpc_opcodes[svc..svcla] in opcodes/ppc-opc.c. */
>> + if ((op & 0xffff0000) == 0x44000000)
>> + /* Never skip system calls. */
>> + break;
>> +
>> if (num_skip_non_prologue_insns++ > max_skip_non_prologue_insns)
>> /* Do not scan too many insns, scanning insns is expensive with
>> remote targets. */
>>
>
>
> The explanation makes sense, but I think a powerpc maintainer should ack the
> patch.
>
The only mention I found in gdb/MAINTAINERS related to powerpc is Kevin,
and he approved it.
> And I think it would be useful to paste the "disassembly /r" of the _exit
> function in the commit message, showing where the breakpoint used to be
> placed, and where it is placed now.
Ack, good suggestion, done and committed.
Thanks,
- Tom
next prev parent reply other threads:[~2021-11-02 18:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-02 11:33 Tom de Vries
2021-11-02 16:26 ` Simon Marchi
2021-11-02 18:13 ` Tom de Vries [this message]
2021-11-02 16:54 ` Kevin Buettner
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=078020f9-9f2f-3c52-8625-ff426cb8536f@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
--cc=uweigand@de.ibm.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).