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

Simon Marchi
2017-10-03T11:21:16Z

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 ())

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

Simon