From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by sourceware.org (Postfix) with ESMTPS id A70E3385DC0A for ; Fri, 15 May 2020 16:53:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A70E3385DC0A Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 54B0C2B0EE0; Fri, 15 May 2020 12:53:13 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id rkOE8KfTKv3S; Fri, 15 May 2020 12:53:13 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 1CE9C2B0F4B; Fri, 15 May 2020 12:53:13 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 1CE9C2B0F4B X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VzJ213CPm3g4; Fri, 15 May 2020 12:53:13 -0400 (EDT) Received: from [10.0.0.188] (unknown [192.222.164.54]) by mail.efficios.com (Postfix) with ESMTPSA id 49E152B0E6A; Fri, 15 May 2020 12:53:12 -0400 (EDT) Subject: Re: [PATCH v2] gdb: infrun: consume multiple events at each pass in stop_all_threads To: Pedro Alves , Simon Marchi , "Aktemur, Tankut Baris" , "gdb-patches@sourceware.org" Cc: Laurent Morichetti References: <20200224193638.29578-1-simon.marchi@efficios.com> <8402549f-c733-cb8b-918c-4dfb06eeb7a0@redhat.com> <80775539-f358-874b-df16-1e8642e082ca@simark.ca> <5ac9bb7a-6bf0-401f-909e-54d98739685b@palves.net> <7633fb1e-c966-5974-cc67-9c4e7769ff6f@redhat.com> From: Simon Marchi Message-ID: <055a5bff-2e84-f32b-2c55-c52ef0b34b2f@efficios.com> Date: Fri, 15 May 2020 12:53:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <7633fb1e-c966-5974-cc67-9c4e7769ff6f@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 16:53:24 -0000 On 2020-05-15 12:15 p.m., Pedro Alves wrote: > On 5/15/20 5:06 PM, Simon Marchi wrote: >> No, I haven't considered it, but I think I see what you mean. To illustrate this case using >> the remote target, I had to set "maintenance set target-non-stop on", while using >> "target non-stop off". > > I think you meant "set non-stop off" in the last command. Oops, yes. >> Am I missing something, is there a more common scenario where >> it gets called, using the remote target? > > Nope, not missing it -- ideally "maintenance set target-non-stop" would > default to "on", but we're not there yet, unfortunately. > >> >> With the above, when hitting a breakpoint, I do see the stops sent in sequence as part >> of stop_all_threads: >> >> Sending packet: $vCont;t:p25a703.25a71c#86...Packet received: OK >> Sending packet: $vCont;t:p25a703.25a71d#87...Packet received: OK >> Sending packet: $vCont;t:p25a703.25a71e#88...Packet received: OK >> Sending packet: $vCont;t:p25a703.25a71f#89...Packet received: OK >> Sending packet: $vCont;t:p25a703.25a720#54...Packet received: OK > > Exactly. > >> >> which could easily be coalesced. I think a `target_commit_stop` approach that mimics >> `target_commit_resume` would work, without being too invasive. But maybe changing >> the `target_stop` interface to accept multiple ptids would be a better approach for >> the future, since it's more of a step towards the gdbserver-style interface that you >> talked about. In stop_all_threads, it would be quite easy to use: build a vector of >> ptid in this loop: >> >> 4815 /* Go through all threads looking for threads that we need >> 4816 to tell the target to stop. */ >> 4817 for (thread_info *t : all_non_exited_threads ()) >> >> and call target_stop once after the loop. > > I actually forgot you're looking at a native-only target. But even then, > it may help if the debug API level can aggregate stop requests. Otherwise, > it probably wouldn't help you. Exactly. It's still nice to have a way to illustrate the problem with the remote protocol, it makes it more obvious I think. Simon