From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Add "thread-group id" and "id in thread-group" info to -thread-info output
Date: Fri, 17 Mar 2017 15:27:00 -0000 [thread overview]
Message-ID: <111e1bcc-3848-3fd6-2fc5-39749582c4d3@redhat.com> (raw)
In-Reply-To: <e20f7964de78eb91ae5c8dc08a2716da@polymtl.ca>
On 03/15/2017 09:36 PM, Simon Marchi wrote:
> On 2017-02-24 15:22, Simon Marchi wrote:
>> While writing the documentation parts, these question popped to mind:
>>
>> - The type of the id-in-tg field (a string) assumes that a thread
>> belongs to a single group. Currently, the only kind of "thread-group"
>> we have is inferiors. The thread-group terminology suggests that in
>> the future we might have other kinds of thread groups, like
>> user-defined arbitrary groups. Otherwise, why would MI use "thread
>> group" instead of "inferior"? Because of this, do you think that the
>> type of the field will be limiting? For example, should we document
>> right that this field can be a list, when a thread is part of multiple
>> groups, for example?
>>
>> - The format of the id-in-tg field is "1" for inferior/thread-group 1.
>> In -list-thread-groups, the id is shown as "i1". Again, if there are
>> other kinds of groups later, we can assume that we'll need to
>> differentiate the type, so just "1" won't work. For this reason and
>> for consistency with the result of -list-thread-groups, should we show
>> "i1" here as well?
>
> I thought about this a bit more, and I wonder if the solution is not to
> just use "inferior" here.
>
> In MI, so far, the wording "thread-group" was used instead of inferior.
> An inferior is one kind (and the only one at the moment) of
> thread-group. Using "thread-group" instead of "inferior" allows to have
> new kinds of thread-groups in the future, and still have commands that
> make sense (e.g. -list-thread-groups, or the --thread-group switch).
>
> However, in this case, the information we want to convey is specifically
> about inferiors, it will never be about other kinds of thread groups (if
> some ever exist). Since a thread always has exactly one parent inferior
> and exactly one id in this inferior, we don't have the single value vs
> list problem. So I think it would make sense to use "id-in-inf" or
> instead of "id-in-tg" and "inf-num"/"inf-id" instead of "tg-id".
>
> And I think that also takes care of the format issue, "1" vs "i1". "i1"
> is the thread-group id. It is necessary to have the i in case other
> kinds of thread groups appear. But if the field is "inf-num" or
> "inf-id", then we no longer have the include the i.
>
> Thoughts?
Makes sense to me.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-03-17 15:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-19 14:42 Simon Marchi
2017-01-19 14:55 ` Luis Machado
2017-01-19 14:57 ` Simon Marchi
2017-02-20 16:18 ` Simon Marchi
2017-02-23 19:50 ` Pedro Alves
2017-02-24 20:22 ` Simon Marchi
2017-02-24 20:32 ` Simon Marchi
2017-03-15 21:36 ` Simon Marchi
2017-03-17 15:27 ` Pedro Alves [this message]
2017-03-17 15:26 ` Pedro Alves
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=111e1bcc-3848-3fd6-2fc5-39749582c4d3@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@ericsson.com \
--cc=simon.marchi@polymtl.ca \
/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).