<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 11, 2017 at 4:42 PM Peter Collingbourne 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">pcc added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D37655#867084" rel="noreferrer" target="_blank">https://reviews.llvm.org/D37655#867084</a>, @dblaikie wrote:<br>
<br>
> Reckon maybe a test case with two units - one using gnu pubnames, one not, would be worth having to demonstrate that all works fine & is appropriately respected?<br>
<br>
<br>
Added, see `llvm/test/DebugInfo/X86/gnu-public-names-multiple-cus.ll`.<br>
<br>
<br>
<br>
================<br>
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:412-422<br>
+bool DwarfDebug::hasDwarfPubSections(DwarfCompileUnit &CU) const {<br>
   // Opting in to GNU Pubnames/types overrides the default to ensure these are<br>
   // generated for things like Gold's gdb_index generation.<br>
-  if (GenerateGnuPubSections)<br>
+  if (CU.getCUNode()->getGnuPubnames())<br>
     return true;<br>
<br>
   if (DwarfPubSections == Default)<br>
----------------<br>
dblaikie wrote:<br>
> Looks like this function could be moved to be a member of DwarfCompileUnit? (& move the DwarfPubSections opt into the DwarfCompileUnit.cpp file?)<br>
><br>
> Just a thought - see how you feel about it, if you think it's better here, that's fine.<br>
I think that makes sense, done.<br>
<br>
What do you think about removing the `-generate-dwarf-pub-sections` flag entirely? It seems that we only use it in a handful of tests where it looks like it would suffice to use `-debugger-tune` instead. In any event, that can probably be done as a followup.<br></blockquote><div><br>If the sed-based testing seems to suffice, sure - seems OK to remove.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
================<br>
Comment at: llvm/test/DebugInfo/X86/gnu-public-names-gmlt.ll:1<br>
-; RUN: llc -mtriple=x86_64-pc-linux-gnu -filetype=obj < %s -generate-gnu-dwarf-pub-sections | llvm-dwarfdump - | FileCheck --check-prefix=GPUB --check-prefix=CHECK %s<br>
+; RUN: sed -e 's/gnuPubnames: false/gnuPubnames: true/' %s | llc -mtriple=x86_64-pc-linux-gnu -filetype=obj | llvm-dwarfdump - | FileCheck --check-prefix=GPUB --check-prefix=CHECK %s<br>
 ; RUN: llc -mtriple=x86_64-pc-linux-gnu -filetype=obj < %s -generate-dwarf-pub-sections=Enable | llvm-dwarfdump - | FileCheck --check-prefix=PUB --check-prefix=CHECK %s<br>
----------------<br>
dblaikie wrote:<br>
> Is this use of 'sed' in a RUN line portable to windows (I forget exactly which command line tools are available/dependendable in the lit environment there)?<br>
I think so, we are using sed like this in a few places already: <a href="http://llvm-cs.pcc.me.uk/?q=RUN%3A+sed" rel="noreferrer" target="_blank">http://llvm-cs.pcc.me.uk/?q=RUN%3A+sed</a><br>
<br>
<br>
<a href="https://reviews.llvm.org/D37655" rel="noreferrer" target="_blank">https://reviews.llvm.org/D37655</a><br>
<br>
<br>
<br>
</blockquote></div></div>