[PATCH] D37771: llvm-dwarfdump: automatically dump both regular and .dwo variant of sections

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 14:39:55 PDT 2017


On Wed, Sep 13, 2017 at 2:35 PM Adrian Prantl via Phabricator <
reviews at reviews.llvm.org> wrote:

> 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?
>

Sounds good to me (one extra, perhaps: "in a .dwo file: empty non-dwo
section headers are skipped")


>
>
> https://reviews.llvm.org/D37771
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170913/022990c3/attachment.html>


More information about the llvm-commits mailing list