From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20758 invoked by alias); 20 Jan 2011 16:19:00 -0000 Received: (qmail 20746 invoked by uid 22791); 20 Jan 2011 16:18:58 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate7.uk.ibm.com (HELO mtagate7.uk.ibm.com) (194.196.100.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Jan 2011 16:18:50 +0000 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p0KGIlZZ032034 for ; Thu, 20 Jan 2011 16:18:47 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0KGIodo1306682 for ; Thu, 20 Jan 2011 16:18:50 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0KGIlNM015376 for ; Thu, 20 Jan 2011 09:18:47 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p0KGIkB1015294; Thu, 20 Jan 2011 09:18:46 -0700 Message-Id: <201101201618.p0KGIkB1015294@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 20 Jan 2011 17:18:46 +0100 Subject: Re: [rfc][2/2] Signal delivery + software single-step is broken To: pedro@codesourcery.com (Pedro Alves) Date: Thu, 20 Jan 2011 23:28:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <201101191330.36859.pedro@codesourcery.com> from "Pedro Alves" at Jan 19, 2011 01:30:36 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: 2011-01/txt/msg00429.txt.bz2 Pedro Alves wrote: > On Wednesday 19 January 2011 11:48:20, Ulrich Weigand wrote: > > Presumably because of this, gdbserver today does not appear to be > > implementing this particular optimization at all, but always reports > > all signals back to GDB to decide what to do with them. > > It does implement it. It's done in gdbserver/linux-low.c:linux_wait_1. > Look for: > > (pass_signals[target_signal_from_host (WSTOPSIG (w))] D'oh, I somehow completely missed that. Sorry. > In linux-nat.c's case, stop_soon used to be set to STOP_QUIETLY > while doing the startup_inferior dance, but it no longer does ever > since you've rewriten startup_inferior to not use wait_for_inferior, > but use target_resume/target_wait directly, I think. I guess it > may be a bug that stop_soon is no longer set in that case? Actually, IIRC one of the reasons for the startup_inferior was to *get away* from using the magic stop_soon flag to influence the behaviour in somewhat under-defined ways, but instead just directly handle whatever events we expect here. I probably wasn't aware that the *target* itself directly uses the flag too ... In any case, if we move to a solution where we toggle the signal pass flags as needed, we should simply set all signals to non-pass during startup too. > The flag is also set to STOP_QUIETLY in svr4_solib_create_inferior_hook, > but that's in code that only gets built for SCO. In this case, > if we cared for SCO, I'd say we'd wrap the loop in > svr4_solib_create_inferior_hook with the same > QPassSignals dance (the target method in question > is target_notice_signals, btw). Right. I'll see if I can come up with a patch ... Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com