From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60251 invoked by alias); 19 Apr 2017 04:08: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 60213 invoked by uid 89); 19 Apr 2017 04:08:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no 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; Wed, 19 Apr 2017 04:08:44 +0000 Received: by simark.ca (Postfix, from userid 33) id E910C1E165; Wed, 19 Apr 2017 00:08:44 -0400 (EDT) To: Pedro Alves Subject: Re: [PATCH 2/4] Change return type of gdbarch_software_single_step to 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: Wed, 19 Apr 2017 04:08:00 -0000 From: Simon Marchi Cc: gdb-patches@sourceware.org In-Reply-To: <8ccc3ab3-91e8-7121-7494-cce45d31f8b2@redhat.com> References: <20170416141430.2585-1-simon.marchi@polymtl.ca> <20170416141430.2585-3-simon.marchi@polymtl.ca> <8ccc3ab3-91e8-7121-7494-cce45d31f8b2@redhat.com> Message-ID: <25ba594108d0c3c48aa9aa8c876d6ea4@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.4 X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00546.txt.bz2 On 2017-04-18 16:17, Pedro Alves wrote: > On 04/16/2017 03:14 PM, Simon Marchi wrote: >> This is a relatively straightforward patch that changes >> gdbarch_software_single_step so it returns an std::vector >> instead of a VEC (CORE_ADDR). > > LGTM. > > BTW, FYI, in general, {} initialization of vectors may not > always be a good idea. See e.g.: > > > https://akrzemi1.wordpress.com/2016/07/07/the-cost-of-stdinitializer_list/ > > C++17 will make it better (though not fully ideal). > > But in this case CORE_ADDR is a scalar and it doesn't really > matter. Ouch, that's good to know. From what I understand, using {} to return an empty vector has no extra cost though, so we can use that without any problem. Simon