From: Pedro Alves <palves@redhat.com>
To: "Tomas Östlund" <tomas.ostlund@ericsson.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFC/WIP PATCH 00/14] I/T sets (resend)
Date: Thu, 09 Feb 2012 14:36:00 -0000 [thread overview]
Message-ID: <4F33D9BD.7020209@redhat.com> (raw)
In-Reply-To: <4F338167.3020201@ericsson.com>
On 02/09/2012 08:18 AM, Tomas Ãstlund wrote:
> Resending since Pedro changed e-mail
>
> --------
>
> Hi!
>
> I hope it is not too late to give feedback and perhaps influence this
> proposed feature. Let me first say that I think this is a very good
> initiative and I see a lot of potential for it.
It's not. :-)
> This was only some examples to give you a quick overview from where we
> are coming.
Thanks! This is largely in line with the work's original requirements.
>
> Now some actual feedback:
>
> On 01/-10/37 20:59, Pedro Alves wrote:
> [...]
>> Along the idea that we
>> need an intersection operator somehow, an idea I've been kicking in
>> the background, is to make all kinds of objects have the same stand,
>> and require, say, a one letter prefix to identify what kind of object
>> we're specifying. E.g, i for inferior, p for process, t for thread, c
>> for core and a for Ada task. In this scheme, the '.' is really a set
>> intersection operator, and the ',' is the union operator. I'm very
>> much inclined to try this route, but I'm also very interested in
>> learning other's opinions. Here are examples:
>>
>> | Syntax | Meaning |
>> |-------------------------+---------------------------------------------------|
>> | i1.t1 | inferior 1, thread 1 |
>> |-------------------------+---------------------------------------------------|
>> | p123 | all (threads cores, etc.) of process with pid 123 |
>> |-------------------------+---------------------------------------------------|
>> | i1.t[1-100].c1-3 | threads 1 to 100 of iinferior 1, running on |
>> | | cores 1 to 3 |
>> |-------------------------+---------------------------------------------------|
>> | i1.t*.c1-3,workers | same as above, union with all in the user |
>> | | defined set "workers" |
>> |-------------------------+---------------------------------------------------|
>> | workers.~c1-3 | All in the user defined set "workers", except |
>> | | those on cores 1 to 3 |
>> |-------------------------+---------------------------------------------------|
>> | i1.a1-3 | Ada tasks 1 to 3 of inferior 1 |
>> |-------------------------+---------------------------------------------------|
>> | workers.i1,crunchers.i2 | All workers of inferior 1, and |
>> | | all crunchers of inferior 2 |
>> |-------------------------+---------------------------------------------------|
>>
>> WDYT?
>
> I think this is a very good suggestion and a must in order to make all
> objects have the same stand as you say.
Great. I actually implemented most of this.
See the v2 (latest version) of the series at:
http://sourceware.org/ml/gdb-patches/2011-12/msg00550.html
>> The current implementation, borrowing heavilly from the HPD and the
>> syntax we first thought out (see Stan's link above), currently
>> implements the INF.TID form, and as a separate patch, the @core
>> extension.
>
> After some googling I finally found what HPD refers to. I had never
> heard of it before and I'm curious what happened to the initiative?
> Anyway, I've read the specification and think it has a lot of good
> concepts, although it misses (intentionally?) to consider processor
> cores as first class elements. One thing I dislike though is the syntax
> for specifying sets using brackets ([]). Using the command line should
> not be harder that it has to be and using brackets is very awkward,
> especially on many keyboards with non-US layout. For example, on a
> Swedish keyboard, you have to use a combination of ALT GR + 8 to
> produce "[". Also I don't see the point of putting the set
> specification before the actual command.
A agree. On a Portuguese keyboard it's also painful. And that's why
I got rid of []'s in v2.
For example compare the
> operation of doing "step dsp0, dsp1 and dsp4" with our debugger
>
>> step dsp0 dsp1 dsp4
>
> and using the HPD syntax:
>
>> [dsp0,dsp1,dsp4] step
>
> Which one is more natural and easier to type?
See v2. :-)
>
> Quite often in debugging, you reuse earlier debugger commands from
> command history and modify them to apply to some other set of cores or
> threads. This is also more easily done, if what commands should apply
> to, are placed at the end of a command.
>
> We think syntax-wise can spaces or commas be used as separators between
> union members. It is easier to type, will cause fewer typing mistakes
> and it is also easier to visually distinguish between ' ' and '.' than
> between ',' and '.'.
The problem is one of ambiguity when you want to be able to specify
sets as an option, and support other options. E.g.,
break -stop foo bar qux
-stop takes a set as argument. Is the set "foo", or "foo bar"? Perhaps
even "foo bar qux"? You'd need to quote the set somehow, like
break -stop 'foo bar' qux.
which we were trying to avoid (just like []'s)
We could allow optional quoting. Another alternative would be to use some
other characters. I don't know, '.', and ',' seemed quite intuitive to me. Maybe
you could try v2 out a bit. It's still easily accessible in my git, as pointed
out in the v2 series intro.
> If there are historical reasons for supporting the 'postfix' HPD syntax
> we would like to extend the command syntax to support 'infix' as well
> as we have given examples of above.
>
> The HPD syntax does not specify a rationale for putting the set
> specification before the command. What is the reason for that?
It kind of follows from the idea that you can also switch the
set focus permanently. With "itfocus" in v1, or "scope" in v2.
You define your commands to apply to the current
scope. So:
(gdb) itfocus foo / scope foo
(gdb) step
is the same as
(gdb) [foo] step (v1)
or
(gdb) scope foo step (v2)
IOW, you can think of prefix scope as a shorthand. BTW, the v2 syntax is
quite like TotalView's (they call theirs "dfocus", IIRC).
>
>>
>> The following examples exhibit some possible uses of sets:
>>
>> |-------------------------------------------+----------------------------------|
>> | Commands | Behaviour |
>> |-------------------------------------------+----------------------------------|
>> | (gdb) step [.34-59] | Single-step the current |
>> |<lines stepped over> | process's threads whose |
>> | (gdb) | numbers are in the range 34 |
>> | | through 59, inclusive |
>
> Here you are not using the HPD syntax with putting the set before the
> command. Why? Although I like this one better. Now let's just skip the
> brackets :-).
:-) That's what you get while your mind isn't completely sorted out yet.
Please do see the v2 series.
>
>
>> |-------------------------------------------+----------------------------------|
>> | (gdb) step [@2] | Single-step all threads on |
>> |<line stepped over> | core 2 |
>> | (gdb) | |
>
> Hmm, if this means step *all* threads on core 2, how would you express
> the scenario in our debugger, where you can step a single machine code
> instruction on a specified core?
> With your proposed syntax using a letter prefix, should it not instead
> be
>
> (gdb) step [t*.c2]
Yes. The proposed syntax hadn't been implemented yet on the v1. I had written
the new syntax as a proposal of something to be changed after v1. And I did it for v2.
>
>> However, what if the user does:
>>
>> [foo]> itset [1.2]
>> [1.2]> step
>>
>> Here the user has explicitly said it only wants to focus on thread 2.
>> What should the step above resume freely? HPD seems to suggest that
>> the global setting should also be respected, which by default means
>> the whole process is resumed.
>>
>> Let's get back to focusing on the whole process:
>>
>> [1.2]> itset [1.*]
>> focus set to [1.*]
>> [1.*]> step
>>
>> And imagine even that we're only debugging inferior 1.
>> Now, according to HPD, this would step each and every thread of the
>> process. It's equivalent to issuing:
>>
>> [some_default_focus] [1.*] step
>> ^^^^^^^^^^^^^^^^ ^^^
>> prompt explicit set cmd
>>
>>
>> But, this conflicts with GDB's concept of a selected thread, and
>> will be counter to all of our user's expectations... Worse, it's
>> unimplementable on targets that don't do non-stop, so we'd end up
>> with yet another incompatible mode. I'd very much like to merge
>> all modes, not add another!
>
> We totally agree! It is much better to define a flexible command syntax
> that directly supports executing in the execution modes without having
> to do any mode switching.
>
> From our experience we have not seen the need for specifying multiple
> 'execution masters' nor are the semantics of such execution operations
> clear. So if we for example express that simultaneously step 3 cores
> and let all other cores run for that duration, does execution stop when
> the first 'master core' stops ?. Or do we run until all master cores
> stop (but that would mean they are no longer in sync i.e. have run the
> same amount of cycles)? What happens if some master core
> never stops? But by specifying a single execution master, the behavior
> is much more predicable and synchronous.
That's interesting. Thanks!
--
Pedro Alves
next prev parent reply other threads:[~2012-02-09 14:36 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 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: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 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: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 12/14] Fix deref of stale pointer 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 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 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 08/14] Add support for the '@' core operator Pedro Alves
2011-11-30 17:29 ` Tom Tromey
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
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 [this message]
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=4F33D9BD.7020209@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tomas.ostlund@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