Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: Re: [RFC/WIP PATCH 13/14] Make "thread apply all" only loop over threads in the current set
Date: Fri, 16 Dec 2011 18:47:00 -0000	[thread overview]
Message-ID: <201112161846.40373.pedro@codesourcery.com> (raw)
In-Reply-To: <m3boruk3du.fsf@fleche.redhat.com>

On Tuesday 29 November 2011 21:47:09, Tom Tromey wrote:
> >>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
> 
> Pedro> This makes "thread apply all" only loop over threads in the current
> Pedro> set instead of always all threads.
> 
> It seems to me that "thread apply" already has a thread argument, which
> could be syntactically extended to cope with sets:
> 
>     thread apply [1.*] print x
> 
> Then I think the existing syntax can just be mapped to a set:
> 
>     thread apply 1 2 3 print x
>  => thread apply [1,2,3] print x
> 
>     thread apply all print x
>  => thread apply [*] print x
>     (I didn't read the itset patch yet so I don't know if this is still
>     the right syntax, but you get the idea.)
> 
> If you considered this and rejected it, I would be interested in your
> reason.
> 
> I am not strongly wedded to this idea.
> 
> I wonder if your idea might be confusing for users, since "all" is an
> absolute word, but this patch makes it not so.

Yeah.  In a way, it's still "all" something.  But instead of
all in the debug session, it's "all" in current focus.  It's
a similar change as done to, e.g., "continue -a", where -a means "all
in current focus".  I actually tried out the change after finding this:

 http://sourceware.org/ml/gdb/2010-09/msg00035.html

"(...) a "upcmode" of operation where commands like breakpoint, info threads, .. apply
only to UPC threads (a set in your example). Also, "c -a" like commands apply only
to UPC threads. Same with "thread apply all". In essence you are focusing your
debugging to a group of threads. Switching off "upcmode" makes everything go back
to normal (in your case selecting a thread set "all" turns off this feature)."

and thinking that such upcmode could easily be reimplemented this way.
But I only now notice that they also change "info threads".  Hmm.
I'm dropping this patch for now.

> 
> Pedro> I think it might make sense to make "info threads" only list threads
> Pedro> of the current focus too.  WDYT?
> 
> If a command can determine whether it has an explicit prefix (and TBH I
> am not sure it is a good idea to allow this -- and I didn't read that
> patch yet either) 

I don't think that is a good idea either.

> If there is a set meaning "the current focus set" you could:
> 
>    [1.*]> [$] info thread
> 
> ... giving the current set some short moniker like "$" makes it easier
> to use.

That one I think makes sense.  I implemented it for experimentation.

> "info thread" takes thread arguments, so perhaps the same rewriting idea
> used above applies.  This approach would work even without a command
> knowing whether it has explicit context:
> 
>   (gdb) info thread 1 2 3
>   => info thread [1,2,3]
> 
>   (gdb) info thread [$]
>   => focused threads
> 
>   (gdb) info thread [1.*]
>   => threads of inferior 1

This may be what makes most sense.

-- 
Pedro Alves


  reply	other threads:[~2011-12-16 18:47 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-28 15:39 [RFC/WIP PATCH 00/14] I/T sets Pedro Alves
2011-11-28 15:39 ` [RFC/WIP PATCH 02/14] Mask software breakpoints from memory writes too Pedro Alves
2011-12-06 20:40   ` Pedro Alves
2011-12-13 21:26     ` Andreas Schwab
2011-12-13 21:38       ` Pedro Alves
2011-12-14  2:08         ` Andreas Schwab
2011-12-14 12:53           ` Pedro Alves
2011-12-14 12:53             ` Andreas Schwab
2011-12-14 15:06               ` Pedro Alves
2011-12-14 15:38                 ` Joel Brobecker
2011-11-28 15:39 ` [RFC/WIP PATCH 05/14] Add a small helper to get at a thread's inferior Pedro Alves
2011-11-29 21:19   ` Tom Tromey
2011-11-28 15:39 ` [RFC/WIP PATCH 03/14] Flip to set target-async on by default Pedro Alves
2011-11-29 21:18   ` Tom Tromey
2011-12-02 19:16   ` Marc Khouzam
2011-11-28 15:39 ` [RFC/WIP PATCH 01/14] Breakpoints always-inserted and the record target Pedro Alves
2011-11-29 21:09   ` Tom Tromey
2011-12-05 17:04     ` Pedro Alves
2011-11-28 15:40 ` [RFC/WIP PATCH 10/14] Comment out new info breakpoints output, in order to not break the test suite Pedro Alves
2011-11-28 15:40 ` [RFC/WIP PATCH 09/14] I/T set support for breakpoints - trigger set, and stop set Pedro Alves
2011-11-29 22:02   ` Tom Tromey
2011-11-30 19:38     ` Tom Tromey
2011-12-16 19:29     ` Pedro Alves
2011-11-28 15:40 ` [RFC/WIP PATCH 07/14] Expand %ITSET% in the prompt to the current I/T set Pedro Alves
2011-11-29 21:22   ` Tom Tromey
2011-12-16 19:07     ` Pedro Alves
2011-12-16 19:09       ` Tom Tromey
2011-12-16 19:38         ` Pedro Alves
2011-11-28 15:40 ` [RFC/WIP PATCH 12/14] Fix deref of stale pointer Pedro Alves
2011-11-28 15:40 ` [RFC/WIP PATCH 04/14] Implement all-stop on top of a target running non-stop mode Pedro Alves
2011-11-28 15:40 ` [RFC/WIP PATCH 13/14] Make "thread apply all" only loop over threads in the current set Pedro Alves
2011-11-28 18:40   ` Eli Zaretskii
2011-11-28 18:56     ` Pedro Alves
2011-11-29 21:47   ` Tom Tromey
2011-12-16 18:47     ` Pedro Alves [this message]
2011-11-28 15:40 ` [RFC/WIP PATCH 08/14] Add support for the '@' core operator Pedro Alves
2011-11-30 17:29   ` Tom Tromey
2011-11-28 15:45 ` [RFC/WIP PATCH 14/14] Fix manythreads.exp test Pedro Alves
2011-11-28 15:45 ` [RFC/WIP PATCH 06/14] Add base itsets support Pedro Alves
2011-11-28 18:47   ` Eli Zaretskii
2011-11-28 18:56     ` Pedro Alves
2011-11-29 22:07   ` Tom Tromey
2011-11-30 18:54   ` Tom Tromey
2011-12-16 17:26     ` Pedro Alves
2011-11-28 15:46 ` [RFC/WIP PATCH 11/14] Add I/T set support to most execution commands Pedro Alves
2011-11-30 19:27   ` Tom Tromey
2011-11-28 18:10 ` [RFC/WIP PATCH 00/14] I/T sets Pedro Alves
2011-11-30 19:35 ` Tom Tromey
2011-12-16 19:40   ` Pedro Alves
2012-02-09  7:51 ` Tomas Östlund
2012-02-09  8:19 ` [RFC/WIP PATCH 00/14] I/T sets (resend) Tomas Östlund
2012-02-09 14:36   ` Pedro Alves
2012-02-15  9:48     ` Tomas Östlund

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=201112161846.40373.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.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