From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66260 invoked by alias); 10 Apr 2017 02:49:29 -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 66247 invoked by uid 89); 10 Apr 2017 02:49:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Apr 2017 02:49:26 +0000 Received: by simark.ca (Postfix, from userid 33) id 527DD1E7F5; Sun, 9 Apr 2017 22:49:26 -0400 (EDT) To: Tom Tromey Subject: Re: [RFA 03/14] Change find_pcs_for_symtab_line to return a std::vector X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 10 Apr 2017 02:49:00 -0000 From: Simon Marchi Cc: gdb-patches@sourceware.org In-Reply-To: <20170408201208.2672-4-tom@tromey.com> References: <20170408201208.2672-1-tom@tromey.com> <20170408201208.2672-4-tom@tromey.com> Message-ID: <982bb18b8628d794493e23b88c3d0a97@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.4 X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00220.txt.bz2 On 2017-04-08 16:11, Tom Tromey wrote: > This changes find_pcs_for_symtab_line to return a std::vector. This > allows the removal of some cleanups. LGTM, just one suggestion. > diff --git a/gdb/python/py-linetable.c b/gdb/python/py-linetable.c > index 8d17aab..6c9350a 100644 > --- a/gdb/python/py-linetable.c > +++ b/gdb/python/py-linetable.c > @@ -122,23 +122,23 @@ build_linetable_entry (int line, CORE_ADDR > address) > address. */ > > static PyObject * > -build_line_table_tuple_from_pcs (int line, VEC (CORE_ADDR) *vec) > +build_line_table_tuple_from_pcs (int line, const > std::vector &vec) > { > - int vec_len = 0; > - CORE_ADDR pc; > + int vec_len; I'd suggest removing vec_len and using vec.size() everywhere, instead of a mix of both. And feel free to rename the "vec" variable name to "pcs" :). Thanks, Simon