Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: dje@google.com (Doug Evans)
To: gdb-patches@sourceware.org, sergiodj@linux.vnet.ibm.com
Subject: [RFC] Support TRAP_IS_SYSCALL in status_to_str
Date: Fri, 25 Sep 2009 00:35:00 -0000	[thread overview]
Message-ID: <20090925003532.4861B843AC@ruffy.mtv.corp.google.com> (raw)

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


             reply	other threads:[~2009-09-25  0:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-25  0:35 Doug Evans [this message]
2009-09-25  1:59 ` Sérgio Durigan Júnior

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=20090925003532.4861B843AC@ruffy.mtv.corp.google.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@linux.vnet.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