[llvm] 2c90281 - [DebugInfo][AIX] Set target debugger-tune default to dbx

Jinsong Ji via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 25 18:39:01 PDT 2021


Author: Jinsong Ji
Date: 2021-04-26T01:38:44Z
New Revision: 2c9028170eeb6749373f2f93ad6abdc0164c36a3

URL: https://github.com/llvm/llvm-project/commit/2c9028170eeb6749373f2f93ad6abdc0164c36a3
DIFF: https://github.com/llvm/llvm-project/commit/2c9028170eeb6749373f2f93ad6abdc0164c36a3.diff

LOG: [DebugInfo][AIX] Set target debugger-tune default to dbx

https://reviews.llvm.org/D99400 set clang DefaultDebuggerTuning for AIX
to dbx. However, we still need to update the target default so that llc
and other tools will get the same default debuggertuning, and avoid
passing extra options in LTO.

Reviewed By: #powerpc, shchenz, dblaikie

Differential Revision: https://reviews.llvm.org/D101197

Added: 
    llvm/test/DebugInfo/PowerPC/debugger-tune.ll

Modified: 
    llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/test/DebugInfo/XCOFF/empty.ll
    llvm/test/DebugInfo/XCOFF/explicit-section.ll
    llvm/test/DebugInfo/XCOFF/function-sections.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 62dc3a6b62f3..e6f646560f03 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -362,6 +362,8 @@ DwarfDebug::DwarfDebug(AsmPrinter *A)
     DebuggerTuning = DebuggerKind::LLDB;
   else if (TT.isPS4CPU())
     DebuggerTuning = DebuggerKind::SCE;
+  else if (TT.isOSAIX())
+    DebuggerTuning = DebuggerKind::DBX;
   else
     DebuggerTuning = DebuggerKind::GDB;
 

diff  --git a/llvm/test/DebugInfo/PowerPC/debugger-tune.ll b/llvm/test/DebugInfo/PowerPC/debugger-tune.ll
new file mode 100644
index 000000000000..4590c76361e6
--- /dev/null
+++ b/llvm/test/DebugInfo/PowerPC/debugger-tune.ll
@@ -0,0 +1,41 @@
+; Verify target-based defaults for "debugger tuning," and the ability to
+; override defaults.
+; We use the use of DW_FORM_string (rather than DW_FORM_strp) to distinguish the debugger tuning.
+
+; Verify defaults for various targets.
+; RUN: llc -mtriple=powerpc64le-unknown-linux -filetype=obj < %s | llvm-dwarfdump -debug-info --show-form - | FileCheck --check-prefix=GDB %s --implicit-check-not DW_FORM_string
+; TODO: Use -filetype-obj and llvm-dwarfdump when the obj mode is supported.
+; RUN: llc -mtriple=powerpc64-ibm-aix-xcoff < %s | FileCheck --check-prefix=DBX --implicit-check-not DW_FROM_strp %s
+
+; We can override defaults.
+; RUN: llc -mtriple=powerpc64le-unknown-linux -filetype=obj -debugger-tune=dbx < %s | llvm-dwarfdump -debug-info --show-form - | FileCheck --check-prefix=DBX %s --implicit-check-not DW_FROM_strp
+; RUN: llc -mtriple=powerpc64-ibm-aix-xcoff -debugger-tune=gdb < %s | FileCheck --check-prefix=GDB %s --implicit-check-not DW_FORM_string
+
+; GDB: DW_FORM_strp
+; DBX: DW_FORM_string
+
+; Function Attrs: noinline nounwind optnone
+define i32 @main() #0 !dbg !8 {
+entry:
+  %retval = alloca i32, align 4
+  store i32 0, i32* %retval, align 4
+  ret i32 0, !dbg !12
+}
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5, !6}
+!llvm.ident = !{!7}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
+!1 = !DIFile(filename: "1.c", directory: "debug")
+!2 = !{}
+!3 = !{i32 7, !"Dwarf Version", i32 4}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"wchar_size", i32 2}
+!6 = !{i32 7, !"PIC Level", i32 2}
+!7 = !{!"clang version 12.0.0"}
+!8 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !9, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!9 = !DISubroutineType(types: !10)
+!10 = !{!11}
+!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!12 = !DILocation(line: 3, column: 3, scope: !8)

diff  --git a/llvm/test/DebugInfo/XCOFF/empty.ll b/llvm/test/DebugInfo/XCOFF/empty.ll
index 526b90d10ece..775cdf325726 100644
--- a/llvm/test/DebugInfo/XCOFF/empty.ll
+++ b/llvm/test/DebugInfo/XCOFF/empty.ll
@@ -1,7 +1,7 @@
 
-; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | \
+; RUN: llc -debugger-tune=gdb -mtriple powerpc-ibm-aix-xcoff < %s | \
 ; RUN:   FileCheck %s --check-prefix=ASM32
-; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | \
+; RUN: llc -debugger-tune=gdb -mtriple powerpc64-ibm-aix-xcoff < %s | \
 ; RUN:   FileCheck %s --check-prefix=ASM64
 
 source_filename = "1.c"

diff  --git a/llvm/test/DebugInfo/XCOFF/explicit-section.ll b/llvm/test/DebugInfo/XCOFF/explicit-section.ll
index 4839fb83e550..a34b22a2299f 100644
--- a/llvm/test/DebugInfo/XCOFF/explicit-section.ll
+++ b/llvm/test/DebugInfo/XCOFF/explicit-section.ll
@@ -1,5 +1,5 @@
 
-; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | \
+; RUN: llc -debugger-tune=gdb -mtriple powerpc-ibm-aix-xcoff < %s | \
 ; RUN:   FileCheck %s
 
 source_filename = "2.c"

diff  --git a/llvm/test/DebugInfo/XCOFF/function-sections.ll b/llvm/test/DebugInfo/XCOFF/function-sections.ll
index cdcd01cd2119..1c4556f742b8 100644
--- a/llvm/test/DebugInfo/XCOFF/function-sections.ll
+++ b/llvm/test/DebugInfo/XCOFF/function-sections.ll
@@ -1,5 +1,5 @@
 
-; RUN: llc -mtriple powerpc-ibm-aix-xcoff -function-sections \
+; RUN: llc -debugger-tune=gdb -mtriple powerpc-ibm-aix-xcoff -function-sections \
 ; RUN:   < %s | FileCheck %s
 
 source_filename = "1.c"


        


More information about the llvm-commits mailing list