This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 09/11] Use std::set in mi-main.c
- From: Tom Tromey <tom at tromey dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Tue, 03 Oct 2017 05:39:39 -0600
- Subject: Re: [RFA 09/11] Use std::set in mi-main.c
- Authentication-results: sourceware.org; auth=none
- References: <20170912185736.20436-1-tom@tromey.com> <20170912185736.20436-10-tom@tromey.com> <ba4c729382a39071171a07ccece5c6a5@polymtl.ca>
>>>>> "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