[Lldb-commits] [lldb] [lldb] Fix a crash when using .dwp files and make type lookup reliable with the index cache (PR #79544)

David Blaikie via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 30 16:51:56 PST 2024


dwblaikie wrote:

> Even if we want to have the skeleton compile unit be parsed first, we would need to know this from any accelerator table entry, wether it be from .debug_names or from our internal manual index. 

True enough, but I think letting this become a lazy property post-construction is a bit more problematic as it might lead to more complicated invariants/situations further downstream. By making it a precondition that any split unit, on construction, has the association with the skeleton unit - there would be fewer "interesting" situations later where the lookup occurs when someone isn't expecting it. The split unit isn't useful without the skeleton for addresses, etc, so it's not like delaying the skeleton lookup provides better performance, etc.

> Our internal manual index creates a DIERef object with a magic .dwp file index + a DIE offset within the .debug_info.dwo in the dwp file. 

(side note: it'd be great if the internal manual index was closer to .debug_names (especially the serialized version - it'd be good if that /was/ .debug_names) - to ensure consistency (& at least last I checked the cached manual index - the debugger startup time was impacted by loading that index off-disk, when the .debug_names/.apple_names indexes don't need to be loaded from disk) & fewer support paths/less code to maintain)

Presumably the entry would still need to mention which CU in the .dwp file it comes from - and presumably the non-split entries in this index would also mention which CU they come from (by offset in the .debug_info section)? (because reading a DIE without knowing wihch CU it's in isn't helpful - you need CU properties, etc)

(but I'm not an lldb maintainer, so can take all this with a few grains of salt)

https://github.com/llvm/llvm-project/pull/79544


More information about the lldb-commits mailing list