[PATCH] D54497: [ELF] --gdb-index: extract entities from .debug_info when .debug_gnu_pubnames is absent

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 14 21:23:45 PST 2018


dblaikie added inline comments.


================
Comment at: ELF/SyntheticSections.cpp:2426
+// `breakpoint` and `print` commands on these symbols slow. Another quirk is
+// that gdb.lookup_global_symbol(symbol) will always return None even if the
+// symtab is loaded.
----------------
ruiu wrote:
> MaskRay wrote:
> > ruiu wrote:
> > > What is the consequence of the function always returning None?
> > Our internal script may break weirdly. I may not sure if this information is useful and I am happy to remove it.
> I'm not sure if this is a good thing to create a half-baked .gdb-index section for an incomplete input. Silently creating a .gdb-index that is not complete could be very confusing. I feel like if we do this, we should do this perfectly. Or we should report an warning and should refuse to create a .gdb-index section.
> 
> Can gold create a complete .gdb-index section from object files that don't have .debug_gnu_pubnames sections? What if both .debug_gnu_pubnames and .debug_gnu_pubtypes are absent? (I believe -ggnu-pubnames creates both sections, so it is hard to imagine that an object file contains only one of them though.)
> 
> If gold can still create .gdb-index sections from object files compiled without -ggnu-pubnames, then, what is the point of -ggnu-pubnames option?
Yeah, I tend to agree about half-baking this. Though, equally I don't personally mind if this is done incrementally either (but I'm not sure it makes it that much easier to follow compared to implementing an attempt at the full algorithm up-front).

What's the purpose of gnu-pubnames:
* Linker/debugger (whichever consumes it) performance - when present it's faster to walk the list than to parse all the DWARF to find things
* With Split DWARF it's necessary (to some degree) - the linker can't parse the DWARF (because the linker doesn't see most of the DWARF - it's in the .dwo file/not present in the objects that are being linked) so it must rely on gnu-pubnames to build the gdb-index in that case. (I say necessary to some degree, because in theory the debugger could still go and read all the debug info in the .dwo/.dwps - it'd be insanely slow, but possible - but in fact GDB relies on the presence of the .gdb_index for correctness (When reading split DWARF it doesn't have a fallback to build the index itself from the DWARF))


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D54497





More information about the llvm-commits mailing list