Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] Support TRAP_IS_SYSCALL in status_to_str
@ 2009-09-25  0:35 Doug Evans
  2009-09-25  1:59 ` Sérgio Durigan Júnior
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Evans @ 2009-09-25  0:35 UTC (permalink / raw)
  To: gdb-patches, sergiodj

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


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

* Re: [RFC] Support TRAP_IS_SYSCALL in status_to_str
  2009-09-25  0:35 [RFC] Support TRAP_IS_SYSCALL in status_to_str Doug Evans
@ 2009-09-25  1:59 ` Sérgio Durigan Júnior
  0 siblings, 0 replies; 2+ messages in thread
From: Sérgio Durigan Júnior @ 2009-09-25  1:59 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

Hi Doug,

On Thursday 24 September 2009, Doug Evans wrote:
> linux-nat.c:status_to_str needs to handle TRAP_IS_SYSCALL.

You are right.

> Any objections to this?

No, not for me.  Thank you for addressing this issue, and sorry about it.

Regards,

-- 
Sérgio Durigan Júnior
Linux on Power Toolchain - Software Engineer
Linux Technology Center - LTC
IBM Brazil


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

end of thread, other threads:[~2009-09-25  1:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-25  0:35 [RFC] Support TRAP_IS_SYSCALL in status_to_str Doug Evans
2009-09-25  1:59 ` Sérgio Durigan Júnior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox