[llvm] [LLVM][DWARF] Add support for .gnu_debuglink (PR #77715)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 11:18:17 PST 2024


dwblaikie wrote:

@kevinfrei since you just posted some debuginfod work (#78605) I'm tagging you in here (though perhaps @petrhosek has some thoughts/other folks that'd want to be involved)

Seems like between debuginfod and gnu_debuglink - those are at least two ways to lookup the original binary with debug info given a stripped binary, and we should have some unified way/place that attempts these various resolution options.

---
Ah, I think I see why you're adding the GnuLink member (now that I see it has no usage, it's only a lifetime issue) - because usually the lifetime of the object is managed by the caller of DWARFContext::create, but because create is opening a new object it has to preserve the object's lifetime longer.

I think I'd still rather see that not affect DWARFContext's members - for instance, DWARFContext::create could take a non-const reference to `object::OwningBinary<object::ObjectFile>` and replace it with the linked object.

Or it could be a separate function - possibly exposed by DWARFContext (but I know you want something to be a drop-in replacement for all DWARFContext usage & this wouldn't provide that) that takes the OwningBinary/ObjectFile and remaps it, if necessary, to the linked debug info (gnu_debuglink, debuginfod, or whatever else).


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


More information about the llvm-commits mailing list