This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Add "thread-group id" and "id in thread-group" info to -thread-info output
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Fri, 17 Mar 2017 15:27:37 +0000
- Subject: Re: [PATCH] Add "thread-group id" and "id in thread-group" info to -thread-info output
- Authentication-results: sourceware.org; auth=none
- References: <20170119144130.4341-1-simon.marchi@ericsson.com> <7bbd57e2-f35d-88fe-8b44-4bb5dff9b60b@ericsson.com> <2b68f0be-721b-08da-079f-9c1e05ae98b7@redhat.com> <480e785582e3631a5f693080f9855d2a@polymtl.ca> <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