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

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 12:42:21 PST 2024


================
@@ -127,6 +127,9 @@ class DWARFContext : public DIContext {
 
   std::unique_ptr<const DWARFObject> DObj;
 
+  /// Binary containing debug information after objcopy --only-keep-debug
+  object::OwningBinary<object::ObjectFile> GnuLink;
----------------
ayermolo wrote:

> Could we avoid having this sort of invasive change by switching entirely to the debuglink binary early on & then the rest of the codepaths would work as they do today? (perhaps look at where the debuginfod is wired in - I would tihnk debuglink might work in a similar way?)

OK poking around llvm source code looks like DebugInfoD is used on adhoc bases in various tools.
DebuginfodFetcher -- used in llvm-objdump, llvm-symbolizer, llvm-cov
Looking into APIs declared in Debuginfod.h used in LLDB, llvm-debuginfod-find

So doesn't look like there is a central place where it is "automatically" supported, and it's up to each tool to add support for it.

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


More information about the llvm-commits mailing list