public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][gdb/tdep, rs6000] Don't skip system call in skip_prologue
@ 2021-11-02 11:33 Tom de Vries
  2021-11-02 16:26 ` Simon Marchi
  2021-11-02 16:54 ` Kevin Buettner
  0 siblings, 2 replies; 4+ messages in thread
From: Tom de Vries @ 2021-11-02 11:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Ulrich Weigand, Kevin Buettner, Carl Love

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.  */

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-02 18:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-02 11:33 [PATCH][gdb/tdep, rs6000] Don't skip system call in skip_prologue Tom de Vries
2021-11-02 16:26 ` Simon Marchi
2021-11-02 18:13   ` Tom de Vries
2021-11-02 16:54 ` Kevin Buettner

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).