[PATCH 01/14] Fix latent bug in dwarf2_find_containing_comp_unit

Simon Marchi simark@simark.ca
Thu Feb 20 15:44:00 GMT 2020


On 2020-02-19 7:12 p.m., Tom Tromey wrote:
> Simon> By refactoring the code a bit, we could maybe factor out the
> Simon> meat of this function into one that operates on an std::vector<dwarf2_per_cu_data> instead
> Simon> of on a dwarf2_per_objfile.  It should then be feasible to create an std::vector with
> Simon> dwarf2_per_cu_data elements out of thin air to unit-test the function, including edge
> Simon> cases like this.
> 
> Oops, I meant to attach the patch in that last email.
> 
> Let me know what you think.
> 
> Tom

Thanks, that LGTM.  If you want to use std::binary_search, that would be fine
as well.

Simon



More information about the Gdb-patches mailing list