From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15049 invoked by alias); 28 Sep 2009 19:58:39 -0000 Received: (qmail 15039 invoked by uid 22791); 28 Sep 2009 19:58:39 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Sep 2009 19:58:35 +0000 Received: (qmail 10091 invoked from network); 28 Sep 2009 19:58:33 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 28 Sep 2009 19:58:33 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFC] mask off is-syscall bit for TRAP_IS_SYSCALL Date: Mon, 28 Sep 2009 19:58:00 -0000 User-Agent: KMail/1.9.10 Cc: Doug Evans , sergiodj@linux.vnet.ibm.com References: <20090928193905.32592843AC@ruffy.mtv.corp.google.com> In-Reply-To: <20090928193905.32592843AC@ruffy.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909282058.49161.pedro@codesourcery.com> 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/msg00888.txt.bz2 On Monday 28 September 2009 20:39:05, Doug Evans wrote: > Hi. > > On one system I use (bi-arch ubuntu-hardy clone), > i386-disp-step.exp is failing because the wait status > value linux_nat_wait_1 gets when hitting a system call is 0857f > which gets passed to the upper layers which then get confused > by a signal of 0x85 (== 0x80 | SIGTRAP). > > This patch fixes things by masking off the 0x80 bit before > passing the signal number to up the call chain. > > Ok to check in? This seems OK-is to me, although I see one extra case that isn't handled correctly: stop_wait_callback: status = wait_lwp (lp); ... if (WSTOPSIG (status) != SIGSTOP) { if (WSTOPSIG (status) == SIGTRAP) { ... } else { /* If the lp->status field is still empty, use it to hold this event. If not, then this event must be returned to the event queue of the LWP. */ if (lp->status) { if (debug_linux_nat) { fprintf_unfiltered (gdb_stdlog, "SWC: kill %s, %s\n", target_pid_to_str (lp->ptid), status_to_str ((int) status)); } kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (status)); <<<<<<<< } It seems we can reach that <<< marked code with a TRAP_IS_SYSCALL, but, I doubt that we want to requeue that signal in the kernel (?). -- Pedro Alves