From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Ulrich Weigand <uweigand@de.ibm.com>,
Kevin Buettner <kevinb@redhat.com>, Carl Love <cel@us.ibm.com>
Subject: [PATCH][gdb/tdep, rs6000] Don't skip system call in skip_prologue
Date: Tue, 2 Nov 2021 12:33:04 +0100 [thread overview]
Message-ID: <20211102113302.GA7990@delia.home> (raw)
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. */
next reply other threads:[~2021-11-02 11:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-02 11:33 Tom de Vries [this message]
2021-11-02 16:26 ` Simon Marchi
2021-11-02 18:13 ` Tom de Vries
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=20211102113302.GA7990@delia.home \
--to=tdevries@suse.de \
--cc=cel@us.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=kevinb@redhat.com \
--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).