Hi KJ, On Sun, 2021-10-03 at 16:05 +1100, KJ Tsanaktsidis via Elfutils-devel wrote: > I guess we don't want to hide some really expensive traversal > operation inside a simple call to dwarf_aggregate_size, no... > > What if we instead provide a way for the user to specify what > language > a CU is? Like "dwarf_cu_report_language(Dwarf_Die *cu, int lang)". > That would get saved with the (partial) CU, and dwarf_srclang could > retrieve this information (if DW_AT_language isn't set). Then, the > user could recursively traverse all CUs and call > dwarf_cu_report_language on each partial CU. And as a bonus, we could > even wrap that up in dwarf_cu_traverse_partial_cu_set_language or > something (OK, the name needs a bit of workshopping). > > That way, the expensive thing is in a separate call that's marked as > being very expensive (and cached, so it only needs to be done once). > Sound like a reasonable approach?
Sorry for forgetting about this discussion. I do think the above makes sense. I opened a bug to track this: https://sourceware.org/bugzilla/show_bug.cgi?id=28578 Cheers, Mark