Re: [PATCH v3 4/7] Per-inferior/Inferior-qualified thread IDs

Pedro Alves
2016-01-07T22:24:35Z

On 01/07/2016 10:01 PM, Simon Marchi wrote:
> Oh, one comment I forgot:
>
> On 16-01-06 08:03 AM, Pedro Alves wrote:
>> + A range will be of the form
>> + <inferior_num>.<thread_number1>-<thread_number1> and will represent
>> + all the threads of inferior inferior_num with number between
>> + thread_number1 and thread_number2, inclusive. <inferior_num> can
>> + also be omitted, as in <thread_number1>-<thread_number1>, in which
>> + case GDB infers the inferior number from the current inferior.
>
> Because this class^Wstruct and associated functions are disconnected from
> the global GDB state (which is great), it would be more accurate to say
> something like "from the default passed to the constructor^Winit function.

Thanks for noticing that, I'll fix. The code used to rely on the
global state when I wrote the comment, then forgot to update it.

(While writing the tests I noticed that "info threads 1.1 2.1 3" would try
to print thread 2.3 instead of 1.3 otherwise, because "info threads" switches
context to each thread being printed, which meant that by the
time we got to "3", the current inferior was 2, while the current
inferior before the command was entered was 1.)

Thanks,
Pedro Alves