This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC] Support TRAP_IS_SYSCALL in status_to_str
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org, sergiodj at linux dot vnet dot ibm dot com
- Date: Thu, 24 Sep 2009 17:35:32 -0700 (PDT)
- Subject: [RFC] Support TRAP_IS_SYSCALL in status_to_str
Hi.
linux-nat.c:status_to_str needs to handle TRAP_IS_SYSCALL.
Any objections to this?
Another way to go is to not special-case SIGTRAP | 0x80,
and just always mask off 0x80. Not knowing of any other
possibility when (0x80 | signo) can happen, I took a minimalist approach.
2009-09-24 Doug Evans <dje@google.com>
* linux-nat.c (status_to_str): Handle TRAP_IS_SYSCALL.
Index: linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.c,v
retrieving revision 1.147
diff -u -p -r1.147 linux-nat.c
--- linux-nat.c 15 Sep 2009 03:30:06 -0000 1.147
+++ linux-nat.c 25 Sep 2009 00:22:31 -0000
@@ -980,8 +980,14 @@ status_to_str (int status)
static char buf[64];
if (WIFSTOPPED (status))
- snprintf (buf, sizeof (buf), "%s (stopped)",
- strsignal (WSTOPSIG (status)));
+ {
+ if (WSTOPSIG (status) == TRAP_IS_SYSCALL)
+ snprintf (buf, sizeof (buf), "%s (stopped at syscall)",
+ strsignal (SIGTRAP));
+ else
+ snprintf (buf, sizeof (buf), "%s (stopped)",
+ strsignal (WSTOPSIG (status)));
+ }
else if (WIFSIGNALED (status))
snprintf (buf, sizeof (buf), "%s (terminated)",
strsignal (WSTOPSIG (status)));