From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61116 invoked by alias); 19 Apr 2016 15:17:05 -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 61104 invoked by uid 89); 19 Apr 2016 15:17:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1945 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 19 Apr 2016 15:16:59 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E588B3E50D6; Tue, 19 Apr 2016 15:16:57 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3JFGugH026931; Tue, 19 Apr 2016 11:16:57 -0400 Subject: Re: [PATCH 3/7] Force to insert software single step breakpoint To: Yao Qi References: <1458749384-19793-1-git-send-email-yao.qi@linaro.org> <1458749384-19793-4-git-send-email-yao.qi@linaro.org> <570BB52F.7@redhat.com> <8660vdk5sk.fsf@gmail.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <57164BE8.90202@redhat.com> Date: Tue, 19 Apr 2016 15:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <8660vdk5sk.fsf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-04/txt/msg00451.txt.bz2 On 04/19/2016 03:54 PM, Yao Qi wrote: > Pedro Alves writes: > >> Another scenario occurred to me: >> >> - Thread A is software single-stepping. >> - Thread B hits single-step breakpoint of thread A. >> - We pause all threads and set thread B stepping past the >> single-step breakpoint of thread A. >> >> But if the single-step breakpoint is for another thread, then >> we won't actually manage to have thread B step past it, resulting >> in spurious re-hits and no-guaranteed forward progress. See >> e.g., non-stop-fair-events.exp: >> >> # On software single-step targets that don't support displaced >> # stepping, threads keep hitting each others' single-step >> # breakpoints, and then GDB needs to pause all threads to step >> # past those. The end result is that progress in the main >> # thread will be slower and it may take a bit longer for the >> # signal to be queued; bump the timeout. >> >> Sounds like we may need to look at the single-step breakpoint's thread >> id, and only insert it if it is for the thread that is going to be >> doing the step-over? We may need to record that in step_over_info and >> pass more info to stepping_past_instruction_at. > > I think this is about any thread specific breakpoint, instead of > only single-step breakpoint (single-step breakpoint is thread specific > too). If we are doing step-over for thread A, do we need to insert any > breakpoints specific to other threads? (my answer is No). Right, we don't need to insert them, because other threads will remain stopped while thread A is doing the step-over. However, given that gdb does not remove/re-insert all breakpoints on internal stops nowadays, removing thread-specific breakpoints of others threads will be less efficient than leaving them be, I think. I mean, you'll get more z0/Z0 traffic than if you leave them inserted. Thanks, Pedro Alves