<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thanks, I'll take a look (tracked by <a href="rdar://problem/50142073" class="">rdar://problem/50142073</a>).<div class=""><br class=""></div><div class="">-- adrian<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 23, 2019, at 1:14 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Recommitted as r359026 with a fix for DICompileUnit's<br class="">nameTableKind:GNU so it no longer suppresses names in apple_names.<br class=""><br class="">But I suspect/encourage someone at Apple to check whether they are<br class="">accidentally getting gnu_pubnames/types in Darwin object files by<br class="">default that they probably don't want/need.<br class=""><br class="">I think this might be a reasonable patch:<br class=""><br class="">--- lib/Driver/ToolChains/Clang.cpp<br class="">+++ lib/Driver/ToolChains/Clang.cpp<br class="">@@ -3332,15 +3332,15 @@ static void RenderDebugOptions(const ToolChain<br class="">&TC, const Driver &D,<br class="">       Args.getLastArg(options::OPT_ggnu_pubnames,<br class="">options::OPT_gno_gnu_pubnames,<br class="">                       options::OPT_gpubnames, options::OPT_gno_pubnames);<br class="">   if (DwarfFission != DwarfFissionKind::None ||<br class="">-      DebuggerTuning == llvm::DebuggerKind::LLDB ||<br class="">       (PubnamesArg && checkDebugInfoOption(PubnamesArg, Args, D, TC)))<br class="">     if (!PubnamesArg ||<br class="">         (!PubnamesArg->getOption().matches(options::OPT_gno_gnu_pubnames) &&<br class="">          !PubnamesArg->getOption().matches(options::OPT_gno_pubnames)))<br class="">-      CmdArgs.push_back(PubnamesArg && PubnamesArg->getOption().matches(<br class="">-                                           options::OPT_gpubnames)<br class="">-                            ? "-gpubnames"<br class="">-                            : "-ggnu-pubnames");<br class="">+      CmdArgs.push_back((PubnamesArg && PubnamesArg->getOption().matches(<br class="">+                                            options::OPT_ggnu_pubnames)) ||<br class="">+                                DwarfFission != DwarfFissionKind::None<br class="">+                            ? "-ggnu-pubnames"<br class="">+                            : "-gpubnames");<br class=""><br class=""><br class="">(really two different things here - just removing the "DebuggerTuning<br class="">== LLDB" case is probably all that's required to remove the<br class="">surprising/probably wrong name table on LLDB platforms - the other<br class="">change, I guess just amounts to a different way to write the same<br class="">thing at that point (once the LLDB case is removed))<br class=""><br class="">On Tue, Apr 23, 2019 at 11:43 AM David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">Hmm, so that's curious. At least when I target darwin from linux (& it<br class="">looks like this'd be the same regardless of host) the Clang driver<br class="">passes -ggnu-pubnames down, and so the IR ends up with DICompileUnit's<br class="">nameTableKind:GNU. And looking at the resulting objects they have both<br class="">apple_names and gnu_pubnames and pubtypes.<br class=""><br class="">Adrian - do you see that too? Is that the case, that Apple platforms<br class="">are getting what would appear to be by accident,<br class="">debug_gnu_pubnames/pubtypes?<br class=""><br class="">(that's a driver/frontend issue - and, yeah, regardless of whether<br class="">that bug happens, LLVM still shouldn't respect the nameTableKind if<br class="">LLVM's emitting apple names - because Apple names can't support a<br class="">missing CU, it has to cover all the CUs in the object. So I have a fix<br class="">for that bit, and need some test coverage. But I feel like there's a<br class="">frontend bug for Apple platforms too)<br class=""><br class="">On Tue, Apr 23, 2019 at 8:18 AM Adrian Prantl <<a href="mailto:aprantl@apple.com" class="">aprantl@apple.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">Thanks! Let me know if you need any help with the analysis.<br class=""><br class="">-- adrian<br class=""><br class=""><blockquote type="cite" class="">On Apr 23, 2019, at 8:02 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:<br class=""><br class="">(oops, this time on-list)<br class=""><br class="">Yep, I can observe a change in size of apple_names under this patch.<br class="">Reverted in r358997 while I investigate.<br class=""><br class="">On Mon, Apr 22, 2019 at 7:11 PM Adrian Prantl <<a href="mailto:aprantl@apple.com" class="">aprantl@apple.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">I haven't tried to reproduce the failure yet, but do you think it's possible this caused the debuginfo-tests to fail?<br class=""><br class=""><a href="http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA/55815/" class="">http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA/55815/</a><br class=""><br class="">It seems to be the only non-NFC change in the blamelist.<br class=""><br class="">-- adrian<br class=""><br class="">On Apr 22, 2019, at 3:45 PM, David Blaikie via llvm-commits <llvm-commits@lists.llvm.org> wrote:<br class=""><br class="">Author: dblaikie<br class="">Date: Mon Apr 22 15:45:11 2019<br class="">New Revision: 358931<br class=""><br class="">URL: http://llvm.org/viewvc/llvm-project?rev=358931&view=rev<br class="">Log:<br class="">DebugInfo: Emit only one kind of accelerated access/name table<br class=""><br class="">Currently to opt in to debug_names in DWARFv5, the IR must contain<br class="">'nameTableKind: Default' which also enables debug_pubnames.<br class=""><br class="">Instead, only allow one of {debug_names, apple_names, debug_pubnames,<br class="">debug_gnu_pubnames}.<br class=""><br class="">nameTableKind: Default gives debug_names in DWARFv5 and greater,<br class="">debug_pubnames in v4 and earlier - and apple_names when tuning for lldb<br class="">on MachO.<br class="">nameTableKind: GNU always gives gnu_pubnames<br class=""><br class="">Added:<br class="">  llvm/trunk/test/DebugInfo/X86/gnu-names.ll<br class="">    - copied, changed from r358805, llvm/trunk/test/DebugInfo/X86/accel-tables.ll<br class="">Modified:<br class="">  llvm/trunk/lib/CodeGen/AsmPrinter/AccelTable.cpp<br class="">  llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br class="">  llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br class="">  llvm/trunk/test/DebugInfo/X86/accel-tables.ll<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AccelTable.cpp<br class="">URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AccelTable.cpp?rev=358931&r1=358930&r2=358931&view=diff<br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/AsmPrinter/AccelTable.cpp (original)<br class="">+++ llvm/trunk/lib/CodeGen/AsmPrinter/AccelTable.cpp Mon Apr 22 15:45:11 2019<br class="">@@ -556,8 +556,8 @@ void llvm::emitDWARF5AccelTable(<br class=""> SmallVector<unsigned, 1> CUIndex(CUs.size());<br class=""> int Count = 0;<br class=""> for (const auto &CU : enumerate(CUs)) {<br class="">-    if (CU.value()->getCUNode()->getNameTableKind() ==<br class="">-        DICompileUnit::DebugNameTableKind::None)<br class="">+    if (CU.value()->getCUNode()->getNameTableKind() !=<br class="">+        DICompileUnit::DebugNameTableKind::Default)<br class="">     continue;<br class="">   CUIndex[CU.index()] = Count++;<br class="">   assert(CU.index() == CU.value()->getUniqueID());<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br class="">URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=358931&r1=358930&r2=358931&view=diff<br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)<br class="">+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Mon Apr 22 15:45:11 2019<br class="">@@ -1036,7 +1036,9 @@ bool DwarfCompileUnit::hasDwarfPubSectio<br class="">   return true;<br class=""> case DICompileUnit::DebugNameTableKind::Default:<br class="">   return DD->tuneForGDB() && !includeMinimalInlineScopes() &&<br class="">-           !CUNode->isDebugDirectivesOnly();<br class="">+           !CUNode->isDebugDirectivesOnly() &&<br class="">+           DD->getAccelTableKind() != AccelTableKind::Apple &&<br class="">+           DD->getDwarfVersion() < 5;<br class=""> }<br class=""> llvm_unreachable("Unhandled DICompileUnit::DebugNameTableKind enum");<br class="">}<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br class="">URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=358931&r1=358930&r2=358931&view=diff<br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br class="">+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Apr 22 15:45:11 2019<br class="">@@ -2765,6 +2765,9 @@ void DwarfDebug::addAccelNameImpl(const<br class="">     CU.getNameTableKind() == DICompileUnit::DebugNameTableKind::None)<br class="">   return;<br class=""><br class="">+  if (CU.getNameTableKind() == DICompileUnit::DebugNameTableKind::GNU)<br class="">+    return;<br class="">+<br class=""> DwarfFile &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder;<br class=""> DwarfStringPoolEntryRef Ref = Holder.getStringPool().getEntry(*Asm, Name);<br class=""><br class=""><br class="">Modified: llvm/trunk/test/DebugInfo/X86/accel-tables.ll<br class="">URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/accel-tables.ll?rev=358931&r1=358930&r2=358931&view=diff<br class="">==============================================================================<br class="">--- llvm/trunk/test/DebugInfo/X86/accel-tables.ll (original)<br class="">+++ llvm/trunk/test/DebugInfo/X86/accel-tables.ll Mon Apr 22 15:45:11 2019<br class="">@@ -4,11 +4,11 @@<br class="">; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj < %s \<br class="">; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=APPLE %s<br class="">; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj -debugger-tune=gdb < %s \<br class="">-; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=NONE %s<br class="">+; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=PUB %s<br class=""><br class="">; Linux does has debug_names tables only if we explicitly tune for lldb<br class="">; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj < %s \<br class="">-; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=NONE %s<br class="">+; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=PUB %s<br class="">; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj -debugger-tune=lldb < %s \<br class="">; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=DEBUG_NAMES %s<br class=""><br class="">@@ -23,15 +23,25 @@<br class="">; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=APPLE %s<br class=""><br class="">; APPLE-NOT: debug_names<br class="">+; APPLE-NOT: pubnames<br class="">; APPLE: apple_names<br class="">; APPLE-NOT: debug_names<br class="">+; APPLE-NOT: pubnames<br class="">+<br class="">+; PUB-NOT: apple_names<br class="">+; PUB-NOT: debug_names<br class="">+; PUB: pubnames<br class="">+; PUB-NOT: apple_names<br class="">+; PUB-NOT: debug_names<br class=""><br class="">; NONE-NOT: apple_names<br class="">; NONE-NOT: debug_names<br class=""><br class="">; DEBUG_NAMES-NOT: apple_names<br class="">+; DEBUG_NAMES-NOT: pubnames<br class="">; DEBUG_NAMES: debug_names<br class="">; DEBUG_NAMES-NOT: apple_names<br class="">+; DEBUG_NAMES-NOT: pubnames<br class=""><br class="">@var = thread_local global i32 0, align 4, !dbg !0<br class=""><br class=""><br class="">Copied: llvm/trunk/test/DebugInfo/X86/gnu-names.ll (from r358805, llvm/trunk/test/DebugInfo/X86/accel-tables.ll)<br class="">URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/gnu-names.ll?p2=llvm/trunk/test/DebugInfo/X86/gnu-names.ll&p1=llvm/trunk/test/DebugInfo/X86/accel-tables.ll&r1=358805&r2=358931&rev=358931&view=diff<br class="">==============================================================================<br class="">--- llvm/trunk/test/DebugInfo/X86/accel-tables.ll (original)<br class="">+++ llvm/trunk/test/DebugInfo/X86/gnu-names.ll Mon Apr 22 15:45:11 2019<br class="">@@ -4,13 +4,13 @@<br class="">; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj < %s \<br class="">; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=APPLE %s<br class="">; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj -debugger-tune=gdb < %s \<br class="">-; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=NONE %s<br class="">+; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=GNU %s<br class=""><br class="">; Linux does has debug_names tables only if we explicitly tune for lldb<br class="">; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj < %s \<br class="">-; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=NONE %s<br class="">+; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=GNU %s<br class="">; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj -debugger-tune=lldb < %s \<br class="">-; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=DEBUG_NAMES %s<br class="">+; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=GNU %s<br class=""><br class="">; No accelerator tables if type units are enabled, as DWARF v4 type units are<br class="">; not compatible with accelerator tables.<br class="">@@ -23,16 +23,20 @@<br class="">; RUN:   | llvm-readobj -sections - | FileCheck --check-prefix=APPLE %s<br class=""><br class="">; APPLE-NOT: debug_names<br class="">+; APPLE-NOT: pubnames<br class="">; APPLE: apple_names<br class="">; APPLE-NOT: debug_names<br class="">+; APPLE-NOT: pubnames<br class="">+<br class="">+; GNU-NOT: apple_names<br class="">+; GNU-NOT: debug_names<br class="">+; GNU: gnu_pub<br class="">+; GNU-NOT: apple_names<br class="">+; GNU-NOT: debug_names<br class=""><br class="">; NONE-NOT: apple_names<br class="">; NONE-NOT: debug_names<br class=""><br class="">-; DEBUG_NAMES-NOT: apple_names<br class="">-; DEBUG_NAMES: debug_names<br class="">-; DEBUG_NAMES-NOT: apple_names<br class="">-<br class="">@var = thread_local global i32 0, align 4, !dbg !0<br class=""><br class="">; Function Attrs: norecurse nounwind readnone uwtable<br class="">@@ -54,7 +58,7 @@ attributes #1 = { norecurse uwtable }<br class=""><br class="">!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())<br class="">!1 = distinct !DIGlobalVariable(name: "var", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)<br class="">-!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 7.0.0 (trunk 322268) (llvm/trunk 322267)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)<br class="">+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 7.0.0 (trunk 322268) (llvm/trunk 322267)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: GNU)<br class="">!3 = !DIFile(filename: "debugger-tune.cpp", directory: "/tmp")<br class="">!4 = !{}<br class="">!5 = !{!0}<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class="">llvm-commits@lists.llvm.org<br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""><br class=""><br class=""></blockquote></blockquote><br class=""></blockquote></blockquote></div></div></blockquote></div><br class=""></div></body></html>