Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@ericsson.com>
Cc: gdb-patches@sourceware.org,
	       Antoine Tremblay <antoine.tremblay@ericsson.com>
Subject: Re: [PATCH master+7.12 v2 2/3] Emit inferior, thread and frame selection events to all UIs
Date: Fri, 16 Sep 2016 18:26:00 -0000	[thread overview]
Message-ID: <11df053c-4103-8af9-6875-5d8eb594a819@redhat.com> (raw)
In-Reply-To: <07211f1c-5e9e-3bfc-9fbe-481ae350b6ac@ericsson.com>

On 09/15/2016 05:20 PM, Simon Marchi wrote:
> On 16-09-14 02:30 PM, Pedro Alves wrote:
>> We could solve that by adding the thread group id (inferior id) to
>> the notification, I think:
>>
>>  =thread-selected,id="3",thread-group="i1",frame="..."
>>
>>  =thread-selected,id="0",thread-group="i2",frame="..."
>>
>> ...
>>

> That sounds good.  I think we can plan this for 7.13 though, the goal now is
> to get the basic use cases working, while not breaking any previous ones.

OK.

>> But, I suspect that we end up suppressing this case:
>>
>> (gdb) define thread-foo
>>> thread $arg0
>>> end
>> (gdb) thread-foo 2
>>
>> Contrived, but certainly not hard to imagine user-commands doing
>> something useful along with changing the selected thread.
>>
>> What happens in this case?
> 
> I think that's actually the opposite.  The purpose of this whole ugly condition
> is to avoid sending a second event, if we removed that whole part with strcmp's,
> we would end up sending events twice.  It would not be nice, but it would not be
> as bad as not sending any event.

Ah!

> That big condition is clearly unclear though :).  I suggest breaking it in its own
> function, where it will be more readable (even though not technically better):

Indeed, that'd be a great boon.

> 
> And then the condition becomes readable, and we understand the intent:
> 
> 
> 	  /* If the command already reports the thread change, no need to do it
> 	     again.  */
> 	  && !command_sends_thread_selected_event (command))
> 	  ...

Awesome!

> 
> 
> To address you uneasiness with -thread-select, let's see how that that code interacts
> with that command.  First, an event about the thread change is sent in
> mi_cmd_thread_select.  Then, command_sends_thread_selected_event will return true,
> making us skip sending the event again.
> 
> WDYT?

I like it.

Thanks,
Pedro Alves


  reply	other threads:[~2016-09-16 18:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 17:46 [PATCH master+7.12 v2 0/3] Emit user selection change notifications on " Simon Marchi
2016-09-14 17:46 ` [PATCH master+7.12 v2 2/3] Emit inferior, thread and frame selection events to " Simon Marchi
2016-09-14 18:30   ` Pedro Alves
2016-09-15 16:21     ` Simon Marchi
2016-09-16 18:26       ` Pedro Alves [this message]
2016-09-14 17:46 ` [PATCH master+7.12 v2 1/3] Introduce cleanup to restore current_uiout Simon Marchi
2016-09-14 17:56   ` Pedro Alves
2016-09-15  3:24     ` Simon Marchi
2016-09-16 18:18       ` Pedro Alves
     [not found]         ` <0c9914b2-f012-3b59-f127-04e70a7f867a@ericsson.com>
2016-10-03 21:25           ` Simon Marchi
2016-09-14 18:11   ` Tom Tromey
2016-09-14 18:18     ` Simon Marchi
2016-09-14 18:32       ` Pedro Alves
2016-09-14 19:12         ` Tom Tromey
2016-09-15  3:17           ` Simon Marchi
2016-09-14 17:46 ` [PATCH master+7.12 v2 3/3] Add test for user context selection sync Simon Marchi
2016-09-14 19:31   ` Pedro Alves
2016-09-16  2:02     ` Simon Marchi
2016-09-21 16:43       ` Pedro Alves
2016-09-21 21:38         ` Simon Marchi
2016-09-22  1:56           ` Simon Marchi

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=11df053c-4103-8af9-6875-5d8eb594a819@redhat.com \
    --to=palves@redhat.com \
    --cc=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.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