Re: [RFA 09/11] Use std::set in mi-main.c

Tom Tromey
2017-10-03T11:39:46Z

>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

Simon> On 2017-09-12 20:57, Tom Tromey wrote:
>> static void
>> -list_available_thread_groups (VEC (int) *ids, int recurse)
>> +list_available_thread_groups (const std::set<int> &ids, int recurse)
>> {
>> struct osdata *data;
>> struct osdata_item *item;
>> @@ -824,12 +795,9 @@ list_available_thread_groups (VEC (int) *ids,
>> int recurse)
>> /* At present, the target will return all available processes
>> and if information about specific ones was required, we filter
>> undesired processes here. */
>> - if (ids && bsearch (&pid_i, VEC_address (int, ids),
>> - VEC_length (int, ids),
>> - sizeof (int), compare_positive_ints) == NULL)
>> + if (!ids.empty () && ids.find (pid_i) != ids.end ())

Simon> I think the condition is the wrong way, it should be == and not !=.
Simon> It probably means we don't have a test for this feature.

Yes, I think you're right. Changing it to == doesn't affect the gdb.mi
test results for me.

Tom