<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 13, 2017 at 2:35 PM Adrian Prantl via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">aprantl added inline comments.<br>
<br>
<br>
================<br>
Comment at: lib/DebugInfo/DWARF/DWARFContext.cpp:242-244<br>
+  auto shouldDumpDWO = [&](unsigned DIDT_Section, StringRef Section) {<br>
+    return (DumpType & DIDT_Section) && (ExplicitDWO || !Section.empty());<br>
+  };<br>
----------------<br>
dblaikie wrote:<br>
> Ah, so one extra wrinkle is that dwo sections can appear in non-dwo files...<br>
><br>
> 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.<br>
><br>
> 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.<br>
><br>
> Does that make sense?<br>
I think so. The behavior as implemented is:<br>
<br>
When specifically requesting a section:<br>
- in a .o file: empty .dwo section headers are skipped<br>
- in a .dwo file: empty .dwo section headers are printed<br>
- in both cases: nonempty .dwo sections are dumped.<br>
<br>
I think this is what we want, right?<br></blockquote><div><br>Sounds good to me (one extra, perhaps: "in a .dwo file: empty non-dwo section headers are skipped")<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<a href="https://reviews.llvm.org/D37771" rel="noreferrer" target="_blank">https://reviews.llvm.org/D37771</a><br>
<br>
<br>
<br>
</blockquote></div></div>