From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2927 invoked by alias); 3 Oct 2017 11:39:46 -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 2676 invoked by uid 89); 3 Oct 2017 11:39:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: gproxy7-pub.mail.unifiedlayer.com Received: from gproxy7-pub.mail.unifiedlayer.com (HELO gproxy7-pub.mail.unifiedlayer.com) (70.40.196.235) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Oct 2017 11:39:44 +0000 Received: from CMOut01 (unknown [10.0.90.82]) by gproxy7.mail.unifiedlayer.com (Postfix) with ESMTP id 2BEF4215DC9 for ; Tue, 3 Oct 2017 05:39:43 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by CMOut01 with id Gzfg1w0022f2jeq01zfjKX; Tue, 03 Oct 2017 05:39:43 -0600 X-Authority-Analysis: v=2.2 cv=K4VSJ2eI c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=02M-m0pO-4AA:10 a=_ZhYKdCeAAAA:8 a=Gepeh9XyBjkheEWEMYUA:9 a=bLsBs1Qw88S74OeP:21 a=LNp8xrMXyrkyki8c:21 a=uqOk3ZSnBfCTOznnrPA1:22 Received: from 75-166-0-208.hlrn.qwest.net ([75.166.0.208]:48506 helo=pokyo) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dzLY3-004H9g-Sh; Tue, 03 Oct 2017 05:39:39 -0600 From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA 09/11] Use std::set in mi-main.c References: <20170912185736.20436-1-tom@tromey.com> <20170912185736.20436-10-tom@tromey.com> Date: Tue, 03 Oct 2017 11:39:00 -0000 In-Reply-To: (Simon Marchi's message of "Tue, 03 Oct 2017 13:21:06 +0200") Message-ID: <87efqkv4sk.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Exim-ID: 1dzLY3-004H9g-Sh X-Source-Sender: 75-166-0-208.hlrn.qwest.net (pokyo) [75.166.0.208]:48506 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Local-Domain: yes X-SW-Source: 2017-10/txt/msg00036.txt.bz2 >>>>> "Simon" == Simon Marchi 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 &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