From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110915 invoked by alias); 1 Jul 2016 15:07:31 -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 110903 invoked by uid 89); 1 Jul 2016 15:07:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1880, forgotten, cancels 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; Fri, 01 Jul 2016 15:07:29 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 3931C8E92F; Fri, 1 Jul 2016 15:07:28 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u61F7RME031768; Fri, 1 Jul 2016 11:07:27 -0400 Subject: Re: [PATCH 8/9] Use reinsert_breakpoint for vCont;s To: Yao Qi , gdb-patches@sourceware.org References: <1467295765-3457-1-git-send-email-yao.qi@linaro.org> <1467295765-3457-9-git-send-email-yao.qi@linaro.org> From: Pedro Alves Message-ID: Date: Fri, 01 Jul 2016 15:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1467295765-3457-9-git-send-email-yao.qi@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-07/txt/msg00013.txt.bz2 On 06/30/2016 03:09 PM, Yao Qi wrote: > V3: - install breakpoints in proceed_one_lwp, if the thread doesn't have > reinsert breakpoints installed yet, > - no longer stop all threads when installing breakpoints, > - delete reinsert breakpoints when GDBserver wants to report event, > >> - Also, if in all-stop mode, if gdb does: >> >> vCont;s:1;c >> >> thus setting thread 1 stepping, and all others continuing, >> and then some other thread but thread 1 hits a breakpoint, >> what is removing the reinsert breakpoint of thread 1? > > if thread 1 doesn't hit the reinsert breakpoint, we don't have to > remove them, because GDB will send vCont;s:1 next time, and GDBserver There's no guarantee GDB will send vCont;s:1 next time. The user may do "continue" instead of "step". > can only install reinsert breakpoints if they are not installed yet. The user may even do "return + continue" or "jump", or an infcall, all of which resume the thread at a different address from the address the thread last stopped. So there's no guarantee that the reinsert breakpoint address makes any sense for the next step request, or even that the next resume request is a step in the first place. Basically the previous step request must be completely forgotten after gdb has seen the thread stop. In all-stop, gdb "sees "all threads stopped on each and every event reported to gdb, for any thread. A stop reply cancels any and all previous resume requests. > if thread hits the reinsert breakpoint, but the event is not reported. > It becomes pending, and GDBserver will delete the reinsert breakpoints > next time when this pending event is reported back to GDB. I don't follow. I'm talking about the case where the thread does _not_ hit the reinsert breakpoint. Instead some other thread hits some unrelated event. Thanks, Pedro Alves