Skip to content

Commit 2c90281

Browse files
author
Jinsong Ji
committed
[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
1 parent c1baf94 commit 2c90281

File tree

5 files changed

+47
-4
lines changed

5 files changed

+47
-4
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ DwarfDebug::DwarfDebug(AsmPrinter *A)
362362
DebuggerTuning = DebuggerKind::LLDB;
363363
else if (TT.isPS4CPU())
364364
DebuggerTuning = DebuggerKind::SCE;
365+
else if (TT.isOSAIX())
366+
DebuggerTuning = DebuggerKind::DBX;
365367
else
366368
DebuggerTuning = DebuggerKind::GDB;
367369

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
; Verify target-based defaults for "debugger tuning," and the ability to
2+
; override defaults.
3+
; We use the use of DW_FORM_string (rather than DW_FORM_strp) to distinguish the debugger tuning.
4+
5+
; Verify defaults for various targets.
6+
; 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
7+
; TODO: Use -filetype-obj and llvm-dwarfdump when the obj mode is supported.
8+
; RUN: llc -mtriple=powerpc64-ibm-aix-xcoff < %s | FileCheck --check-prefix=DBX --implicit-check-not DW_FROM_strp %s
9+
10+
; We can override defaults.
11+
; 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
12+
; RUN: llc -mtriple=powerpc64-ibm-aix-xcoff -debugger-tune=gdb < %s | FileCheck --check-prefix=GDB %s --implicit-check-not DW_FORM_string
13+
14+
; GDB: DW_FORM_strp
15+
; DBX: DW_FORM_string
16+
17+
; Function Attrs: noinline nounwind optnone
18+
define i32 @main() #0 !dbg !8 {
19+
entry:
20+
%retval = alloca i32, align 4
21+
store i32 0, i32* %retval, align 4
22+
ret i32 0, !dbg !12
23+
}
24+
25+
!llvm.dbg.cu = !{!0}
26+
!llvm.module.flags = !{!3, !4, !5, !6}
27+
!llvm.ident = !{!7}
28+
29+
!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)
30+
!1 = !DIFile(filename: "1.c", directory: "debug")
31+
!2 = !{}
32+
!3 = !{i32 7, !"Dwarf Version", i32 4}
33+
!4 = !{i32 2, !"Debug Info Version", i32 3}
34+
!5 = !{i32 1, !"wchar_size", i32 2}
35+
!6 = !{i32 7, !"PIC Level", i32 2}
36+
!7 = !{!"clang version 12.0.0"}
37+
!8 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !9, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
38+
!9 = !DISubroutineType(types: !10)
39+
!10 = !{!11}
40+
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
41+
!12 = !DILocation(line: 3, column: 3, scope: !8)

llvm/test/DebugInfo/XCOFF/empty.ll

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | \
2+
; RUN: llc -debugger-tune=gdb -mtriple powerpc-ibm-aix-xcoff < %s | \
33
; RUN: FileCheck %s --check-prefix=ASM32
4-
; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | \
4+
; RUN: llc -debugger-tune=gdb -mtriple powerpc64-ibm-aix-xcoff < %s | \
55
; RUN: FileCheck %s --check-prefix=ASM64
66

77
source_filename = "1.c"

llvm/test/DebugInfo/XCOFF/explicit-section.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | \
2+
; RUN: llc -debugger-tune=gdb -mtriple powerpc-ibm-aix-xcoff < %s | \
33
; RUN: FileCheck %s
44

55
source_filename = "2.c"

llvm/test/DebugInfo/XCOFF/function-sections.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
; RUN: llc -mtriple powerpc-ibm-aix-xcoff -function-sections \
2+
; RUN: llc -debugger-tune=gdb -mtriple powerpc-ibm-aix-xcoff -function-sections \
33
; RUN: < %s | FileCheck %s
44

55
source_filename = "1.c"

0 commit comments

Comments
 (0)