[PATCH 2/4] Change return type of gdbarch_software_single_step to vector<CORE_ADDR>

Simon Marchi simon.marchi@polymtl.ca
Wed Apr 19 04:08:00 GMT 2017


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<CORE_ADDR>
>> 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



More information about the Gdb-patches mailing list