[PATCH] D37771: llvm-dwarfdump: automatically dump both regular and .dwo variant of sections
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 13 14:35:59 PDT 2017
aprantl added inline comments.
================
Comment at: lib/DebugInfo/DWARF/DWARFContext.cpp:242-244
+ auto shouldDumpDWO = [&](unsigned DIDT_Section, StringRef Section) {
+ return (DumpType & DIDT_Section) && (ExplicitDWO || !Section.empty());
+ };
----------------
dblaikie wrote:
> Ah, so one extra wrinkle is that dwo sections can appear in non-dwo files...
>
> For example when LLVM (& GCC) produce Fission output, they first output a single object file (with all the dwo and non-dwo, and text, etc) then use objcopy to extract the .dwo sections out into a separate file.
>
> So not dumping DWO sections when present, even when not examining a .dwo file, is problematic. But they can silently not have headers (ie: if you ask to dump a types in a .o file, I don't think there's a need to print the types.dwo header if types.dwo is not present) - I think that's OK.
>
> Does that make sense?
I think so. The behavior as implemented is:
When specifically requesting a section:
- in a .o file: empty .dwo section headers are skipped
- in a .dwo file: empty .dwo section headers are printed
- in both cases: nonempty .dwo sections are dumped.
I think this is what we want, right?
https://reviews.llvm.org/D37771
More information about the llvm-commits
mailing list