From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26555 invoked by alias); 3 Oct 2017 11:21:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26540 invoked by uid 89); 3 Oct 2017 11:21:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Oct 2017 11:21:14 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v93BL7D7024823 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 3 Oct 2017 07:21:12 -0400 Received: by simark.ca (Postfix, from userid 112) id 8D4B71E538; Tue, 3 Oct 2017 07:21:07 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id E8CEE1E515; Tue, 3 Oct 2017 07:21:06 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 03 Oct 2017 11:21:00 -0000 From: Simon Marchi To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFA 09/11] Use std::set in mi-main.c In-Reply-To: <20170912185736.20436-10-tom@tromey.com> References: <20170912185736.20436-1-tom@tromey.com> <20170912185736.20436-10-tom@tromey.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 3 Oct 2017 11:21:07 +0000 X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00033.txt.bz2 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 &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