public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: Pedro Alves <palves@redhat.com>, Simon Marchi <simark@simark.ca>,
	"Aktemur, Tankut Baris" <tankut.baris.aktemur@intel.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: Laurent Morichetti <Laurent.Morichetti@amd.com>
Subject: Re: [PATCH v2] gdb: infrun: consume multiple events at each pass in stop_all_threads
Date: Fri, 15 May 2020 12:53:10 -0400	[thread overview]
Message-ID: <055a5bff-2e84-f32b-2c55-c52ef0b34b2f@efficios.com> (raw)
In-Reply-To: <7633fb1e-c966-5974-cc67-9c4e7769ff6f@redhat.com>

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

      reply	other threads:[~2020-05-15 16:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24 19:36 [PATCH] " Simon Marchi
2020-03-11 19:13 ` Simon Marchi
2020-03-25 16:37   ` [PING][PATCH] " Simon Marchi
2020-04-16 17:51 ` [PATCH] " Pedro Alves
2020-04-16 20:32   ` Simon Marchi
2020-05-14 14:32     ` Aktemur, Tankut Baris
2020-05-14 18:02       ` [PATCH v2] " Simon Marchi
2020-05-14 18:14         ` Pedro Alves
2020-05-15 16:06           ` Simon Marchi
2020-05-15 16:15             ` Pedro Alves
2020-05-15 16:53               ` Simon Marchi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=055a5bff-2e84-f32b-2c55-c52ef0b34b2f@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=Laurent.Morichetti@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=simark@simark.ca \
    --cc=tankut.baris.aktemur@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).