Skip to content

Commit cbb3571

Browse files
Djordje Todorovicdjolertrk
authored andcommitted
[DWARF] Avoid entry_values production for SCE
SONY debugger does not prefer debug entry values feature, so the plan is to avoid production of the entry values by default when the tuning is SCE debugger. The feature still can be enabled with the -debug-entry-values option for the testing/development purposes. This patch addresses PR46643. Differential Revision: https://reviews.llvm.org/D83462
1 parent 6a0f074 commit cbb3571

File tree

4 files changed

+21
-17
lines changed

4 files changed

+21
-17
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ static cl::opt<bool> UseDwarfRangesBaseAddressSpecifier(
9595
"use-dwarf-ranges-base-address-specifier", cl::Hidden,
9696
cl::desc("Use base address specifiers in debug_ranges"), cl::init(false));
9797

98-
static cl::opt<bool> EmitDwarfDebugEntryValues(
99-
"emit-debug-entry-values", cl::Hidden,
100-
cl::desc("Emit the debug entry values"), cl::init(false));
101-
10298
static cl::opt<bool> GenerateARangeSection("generate-arange-section",
10399
cl::Hidden,
104100
cl::desc("Generate dwarf aranges"),
@@ -430,9 +426,7 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
430426

431427
// Emit call-site-param debug info for GDB and LLDB, if the target supports
432428
// the debug entry values feature. It can also be enabled explicitly.
433-
EmitDebugEntryValues = (Asm->TM.Options.ShouldEmitDebugEntryValues() &&
434-
(tuneForGDB() || tuneForLLDB())) ||
435-
EmitDwarfDebugEntryValues;
429+
EmitDebugEntryValues = Asm->TM.Options.ShouldEmitDebugEntryValues();
436430

437431
Asm->OutStreamer->getContext().setDwarfVersion(DwarfVersion);
438432
}

llvm/lib/CodeGen/TargetOptionsImpl.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ bool TargetOptions::HonorSignDependentRoundingFPMath() const {
4747
}
4848

4949
/// NOTE: There are targets that still do not support the debug entry values
50-
/// production.
50+
/// production and that is being controlled with the SupportsDebugEntryValues.
51+
/// In addition, SCE debugger does not have the feature implemented, so prefer
52+
/// not to emit the debug entry values in that case.
53+
/// The EnableDebugEntryValues can be used for the testing purposes.
5154
bool TargetOptions::ShouldEmitDebugEntryValues() const {
52-
return SupportsDebugEntryValues || EnableDebugEntryValues;
55+
return (SupportsDebugEntryValues && DebuggerTuning != DebuggerKind::SCE) ||
56+
EnableDebugEntryValues;
5357
}

llvm/test/DebugInfo/MIR/X86/call-site-gnu-vs-dwarf5-attrs.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# RUN: | llvm-dwarfdump - | FileCheck %s -check-prefixes=CHECK-DWARF5 -implicit-check-not=DW_AT_call
2222
#
2323
# RUN: llc -emit-call-site-info -dwarf-version 5 -filetype=obj -debugger-tune=sce \
24-
# RUN: -emit-debug-entry-values -debug-entry-values -mtriple=x86_64-unknown-unknown \
24+
# RUN: -debug-entry-values -mtriple=x86_64-unknown-unknown \
2525
# RUN: -start-after=machineverifier -o - %s | llvm-dwarfdump - | FileCheck %s -check-prefixes=CHECK-DWARF5
2626
#
2727
# This is based on the following reproducer:

llvm/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir renamed to llvm/test/DebugInfo/MIR/X86/debug-entry-value-operation.mir

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
# RUN: llc -start-before=livedebugvalues -mtriple=x86_64-apple-darwin -o %t %s -filetype=obj
22
# RUN: llvm-dwarfdump %t | FileCheck %s
3-
#
4-
# int global;
5-
# int foo(int p, int q, int r) {
6-
# global = p + 1;
7-
# asm __volatile("" : : : "edi", "esi", "edx");
8-
# return 123;
9-
# }
3+
4+
# RUN: llc -start-before=livedebugvalues -debugger-tune=sce -mtriple=x86_64-sce-ps4 -o %t1 %s -filetype=obj
5+
# RUN: llvm-dwarfdump %t1 | FileCheck %s -check-prefix=SCE
6+
7+
## Based on:
8+
## int global;
9+
## int foo(int p, int q, int r) {
10+
## global = p + 1;
11+
## asm __volatile("" : : : "edi", "esi", "edx");
12+
## return 123;
13+
## }
1014

1115
# CHECK: DW_TAG_formal_parameter
1216
# CHECK: DW_OP_entry_value
1317

18+
# SCE-NOT: DW_OP_{{.*}}entry_value
19+
1420
--- |
1521
; ModuleID = 'multiple-param-dbg-value-entry.ll'
1622
source_filename = "multiple-param-dbg-value-entry.c"

0 commit comments

Comments
 (0)