From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23138 invoked by alias); 25 Sep 2009 00:35:42 -0000 Received: (qmail 23130 invoked by uid 22791); 25 Sep 2009 00:35:42 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Sep 2009 00:35:37 +0000 Received: from wpaz1.hot.corp.google.com (wpaz1.hot.corp.google.com [172.24.198.65]) by smtp-out.google.com with ESMTP id n8P0ZYEP000704; Thu, 24 Sep 2009 17:35:34 -0700 Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.118.116]) by wpaz1.hot.corp.google.com with ESMTP id n8P0ZWmN006722; Thu, 24 Sep 2009 17:35:32 -0700 Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id 4861B843AC; Thu, 24 Sep 2009 17:35:32 -0700 (PDT) To: gdb-patches@sourceware.org, sergiodj@linux.vnet.ibm.com Subject: [RFC] Support TRAP_IS_SYSCALL in status_to_str Message-Id: <20090925003532.4861B843AC@ruffy.mtv.corp.google.com> Date: Fri, 25 Sep 2009 00:35:00 -0000 From: dje@google.com (Doug Evans) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00768.txt.bz2 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 * 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)));