[Lldb-commits] [PATCH] D65561: SymbolVendorELF: Perform build-id lookup even without a debug link

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 5 00:52:42 PDT 2019


jankratochvil added a comment.

In D65561#1614293 <https://reviews.llvm.org/D65561#1614293>, @labath wrote:

> That would seem to at odds with your " .gnu_debuglink is considered as a flag" assertion, but I am not sure how you came to believe that.


I see I remembered it wrongly, already the initial build-id implementation for GDB ignored `.gnu_debuglink` <https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=77069918ac29da24f1ae0e388cef2ea5045397fd>.

> That said, I agree the extra filesystem accesses are bad, and they are a completely unintended side-effect of this patch. If that is the only issue, then I think this can be easily fixed by first checking whether the main object file contains any debug info, and skipping the rest of the lookup in that case.

Yes, this is what GDB does:

    /* If the file has its own symbol tables it has no separate debug
       info.  `.dynsym'/`.symtab' go to MSYMBOLS, `.debug_info' goes to
       SYMTABS/PSYMTABS.  `.gnu_debuglink' may no longer be present with
       `.note.gnu.build-id'.
  ...
    else if (!objfile_has_partial_symbols (objfile)   
        std::string debugfile = find_separate_debug_file_by_buildid (objfile);


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65561/new/

https://reviews.llvm.org/D65561





More information about the lldb-commits mailing list