From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66328 invoked by alias); 21 Mar 2016 09:40:06 -0000 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 Received: (qmail 66252 invoked by uid 89); 21 Mar 2016 09:40:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:U*palves, Hx-languages-length:1250 X-HELO: mail-pf0-f193.google.com Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 21 Mar 2016 09:40:03 +0000 Received: by mail-pf0-f193.google.com with SMTP id q129so29740881pfb.3 for ; Mon, 21 Mar 2016 02:40:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=L23WIYfRX7YpratodmJU2HOxCNZzBeog5dh2iWXjoq8=; b=PIiclRoG/XaqHPdECDav3Zw9pktW9EC6UOSlzFg+YDXOtdvYzKdzB340i9zX3KnXIK vPquJzo4AmVUslkZydKqPkyHzWO8Nj6qjs/EfRggyO8NibAT2WLI/rSsahCCUa11fNWw D8Efn96jcSlEw8WS0gSengnvHY0NRz5aCvjqVmt5P5CAq8ZKqBauqnCEjLyHRbdrouWN T8pypT//V5l1PqG5zRctpMVLe1MHLQ5kYrtUBmQ52js0NKr2X0bzR6va3MPBPWgrknat 8xOU4Vp4pK40XZSIiJLpeqo2GyEDAfPzgyP5crLEmgVmzieZ0ZS8DWv8auNBI7aKijMl wQAA== X-Gm-Message-State: AD7BkJJ9RqTeYrCOjQhmf1lNR94YD/dTzvsfvW4TQsIRT2Uvhb/WFio+UV2MMn9CO0pNOg== X-Received: by 10.66.124.167 with SMTP id mj7mr43808629pab.153.1458553201555; Mon, 21 Mar 2016 02:40:01 -0700 (PDT) Received: from E107787-LIN (power-aix.osuosl.org. [140.211.15.154]) by smtp.gmail.com with ESMTPSA id o71sm39070152pfj.68.2016.03.21.02.39.58 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 21 Mar 2016 02:40:00 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH 7/8] Resume the inferior with signal rather than stepping over References: <1457088276-1170-1-git-send-email-yao.qi@linaro.org> <1457088276-1170-8-git-send-email-yao.qi@linaro.org> <56E2B449.7010905@redhat.com> Date: Mon, 21 Mar 2016 09:40:00 -0000 In-Reply-To: <56E2B449.7010905@redhat.com> (Pedro Alves's message of "Fri, 11 Mar 2016 12:04:25 +0000") Message-ID: <868u1cw4ns.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00383.txt.bz2 Pedro Alves writes: > Once the handler returns, it'll retrap the same breakpoint we already sto= pped > for, and thus I think we'll count a spurious tracepoint/breakpoint hit. > > Sounds like we'll need to do like GDB does and remember that we are advan= cing > past a signal handler, and need to get back to stepping over the breakpoi= nt > if/when the handler returns successfully? I think it is no longer an issue as we live with the spurious double trap, right? >>=20=20=20 >> + /* On software single step target, resume the inferior with signal >> + rather than stepping over. */ >> + if (can_software_single_step () >> + && lwp->pending_signals !=3D NULL >> + && LWP_SIGNAL_CAN_BE_DELIVERED (lwp)) >> + { >> + if (debug_threads) >> + debug_printf ("Need step over [LWP %ld]? Ignoring, has pending" >> + " signals.\n", >> + lwpid_of (thread)); >> + >> + return 0; > > I notice this missed restoring the current thread (below). > The code below is to switch current_thread to thread, not restoring. Since we don't switch current_thread here, we don't have to do anything. >> + } >> + >> saved_thread =3D current_thread; >> current_thread =3D thread; --=20 Yao (=E9=BD=90=E5=B0=A7)