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:26:14 +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>
On 02/24/2017 08:22 PM, 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"?
The concept of MI thread groups was added way before the concept
of "inferiors" and inferior numbers was exposed to the user:
https://sourceware.org/ml/gdb-patches/2008-11/msg00044.html
Back then the thread list was global, and we were starting to add
multi-process support to GDB. The OS we were targeting (from Ericsson,
no less) had all processes running the same code (as if a bunch of forks),
which was convenient as it allowed for incremental progress all the
way until we got to real multi-inferior support a few releases later. Back
then, MI thread groups mapped to "processes", and thread groups were
only created when we'd attach to a process.
Later on, when we added real GNU/Linux multi-inferior support (with the
addition of program spaces), we exposed the "prototype inferior" concept
to the user (i.e., the inferior now exists before the user types "run"), and
"thread groups" were re-purposed. See:
https://sourceware.org/ml/gdb-patches/2010-01/msg00358.html
Thanks,
Pedro Alves