Re: [PATCH 07/14] Add dwarf2_per_cu_data::index

Simon Marchi
2020-02-19T05:31:27Z

On 2020-02-18 11:36 p.m., Simon Marchi wrote:
> The "all_cutus" vector does not exist (at least at the moment, maybe it's added later
> in the series?). I presume you are talking about the logical/combined vector made of
> all_comp_units and all_type_units, accessible using dwarf2_per_objfile::get_cutu?
>
> This logical/combined vector has all the comp units first, then the type units. Using
> the new interface allocate_per_cu/allocate_signatured_type, the indices are handed out
> in any order. I don't know if it's actually possible to have it in this order, but let's
> say we read:
>
> - a CU
> - a TU
> - a CU
>
> The CUs will have been handed out indices 0 and 2, and the TU will have been handed out
> index 1. But in reality, when accessing them using get_cutu, the two CUs will be at 0 and
> 1, while the TU will be at 2. Again, not sure if it matters, but I thought I would point
> it out.
>
> Or maybe this is what you meant by "the index here is weird since it may not (!?!?) be the
> same as the other index", this is not the same index? I guess I'll read the rest of the
> series and find out.
>
> Simon

Ok, after reading the next patch I saw that this is indeed referring to an index into another
vector. So I suppose it's just that the "all_cutus" reference is stale, it should say "symtabs"?