[PATCH] Set a debugger "target" to guide DWARF choices

Eric Christopher echristo at gmail.com
Wed May 6 14:52:32 PDT 2015


Inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:211-219
@@ -211,1 +210,11 @@
 
+  // Make sure we know our "debugger tuning."
+  if (Asm->TM.Options.DebuggerTuning == DebuggerKind::Default) {
+    if (IsDarwin)
+      Asm->TM.Options.DebuggerTuning = DebuggerKind::LLDB;
+    else if (Triple(A->getTargetTriple()).isPS4CPU())
+      Asm->TM.Options.DebuggerTuning = DebuggerKind::SCE;
+    else
+      Asm->TM.Options.DebuggerTuning = DebuggerKind::GDB;
+  }
+
----------------
I might have lost this part of the discussion but I thought the default was "no tuning"?

At least not in the backend.

================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:234
@@ -224,3 +233,3 @@
   if (DwarfPubSections == Default)
-    HasDwarfPubSections = !IsDarwin && !IsPS4;
+    HasDwarfPubSections = !IsDarwin && !tuneDebugForSCE();
   else
----------------
This should be simplified to tuneDebugForGDB().

================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:244
@@ -236,1 +243,3 @@
+  // and GDB always wants the GNU opcode.
+  UseGNUTLSOpcode = DwarfVersion < 3 || tuneDebugForGDB();
 
----------------
I don't think this is a tuning option, and that's the problem. This is a correctness issue in that it just won't work rather than being inefficient or superfluous.

================
Comment at: test/DebugInfo/X86/dwarf-public-names.ll:7-10
@@ -6,1 +6,6 @@
 ; RUN: llvm-dwarfdump -debug-dump=pubnames %t.o | FileCheck --check-prefix=NOPUB %s
+; RUN: llc -mtriple=x86_64-pc-linux-gnu -debugger-tune=sce -filetype=obj -o %t.o < %s
+; RUN: llvm-dwarfdump -debug-dump=pubnames %t.o | FileCheck --check-prefix=NOPUB %s
+; RUN: llc -mtriple=x86_64-scei-ps4 -debugger-tune=gdb -filetype=obj -o %t.o < %s
+; RUN: llvm-dwarfdump -debug-dump=pubnames %t.o | FileCheck --check-prefix=LINUX %s
+
----------------
I think I'd like this split out into a different test file.

http://reviews.llvm.org/D8506

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list