[PATCH] D90001: [llvm/DebugInfo] Emit DW_OP_implicit_value when tuning for LLDB
Med Ismail Bennani via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 23 17:12:36 PDT 2020
mib updated this revision to Diff 300439.
mib added a comment.
Fix pre-check test failures
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90001/new/
https://reviews.llvm.org/D90001
Files:
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/test/DebugInfo/X86/implicit_value-double.ll
llvm/test/DebugInfo/X86/implicit_value-float.ll
llvm/test/DebugInfo/X86/stack-value-piece.ll
Index: llvm/test/DebugInfo/X86/stack-value-piece.ll
===================================================================
--- llvm/test/DebugInfo/X86/stack-value-piece.ll
+++ llvm/test/DebugInfo/X86/stack-value-piece.ll
@@ -26,15 +26,15 @@
; CHECK: DW_AT_name ("f")
; CHECK: DW_TAG_variable
; CHECK-NEXT: DW_AT_location ([[F:0x[0-9a-f]+]]
-; CHECK-NEXT: [{{.*}}, {{.*}}): DW_OP_reg17 XMM0, DW_OP_piece 0x4, DW_OP_lit0, DW_OP_stack_value, DW_OP_piece 0x4
-; CHECK-NEXT: [{{.*}}, {{.*}}): DW_OP_piece 0x4, DW_OP_lit0, DW_OP_stack_value, DW_OP_piece 0x4)
+; CHECK-NEXT: [{{.*}}, {{.*}}): DW_OP_reg17 XMM0, DW_OP_piece 0x4, {{(DW_OP_lit0, DW_OP_stack_value, DW_OP_piece 0x4|DW_OP_implicit_value 0x4 0x00 0x00 0x00 0x00)}}
+; CHECK-NEXT: [{{.*}}, {{.*}}): DW_OP_piece 0x4, {{(DW_OP_lit0, DW_OP_stack_value, DW_OP_piece 0x4|DW_OP_implicit_value 0x4 0x00 0x00 0x00 0x00)}})
; CHECK-NEXT: DW_AT_name ("r")
;
; CHECK: .debug_loc contents:
; CHECK: [[I]]:
; CHECK-NEXT: ({{.*}}, {{.*}}): DW_OP_reg5 RDI, DW_OP_piece 0x4, DW_OP_lit0, DW_OP_stack_value, DW_OP_piece 0x4
; CHECK: [[F]]:
-; CHECK-NEXT: ({{.*}}, {{.*}}): DW_OP_reg17 XMM0, DW_OP_piece 0x4, DW_OP_lit0, DW_OP_stack_value, DW_OP_piece 0x4
+; CHECK-NEXT: ({{.*}}, {{.*}}): DW_OP_reg17 XMM0, DW_OP_piece 0x4, {{DW_OP_lit0, DW_OP_stack_value, DW_OP_piece 0x4|DW_OP_implicit_value 0x4 0x00 0x00 0x00 0x00}}
source_filename = "stack-value-piece.c"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
Index: llvm/test/DebugInfo/X86/implicit_value-float.ll
===================================================================
--- llvm/test/DebugInfo/X86/implicit_value-float.ll
+++ llvm/test/DebugInfo/X86/implicit_value-float.ll
@@ -9,6 +9,8 @@
; CHECK-NEXT: [{{.*}}): DW_OP_implicit_value 0x4 0xc3 0xf5 0x48 0x40)
; CHECK-NEXT: DW_AT_name ("f")
+; RUN: llc -debugger-tune=lldb -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s
+
;; Generated from: clang -ggdb -O1
;;int main() {
;; float f = 3.14f;
Index: llvm/test/DebugInfo/X86/implicit_value-double.ll
===================================================================
--- llvm/test/DebugInfo/X86/implicit_value-double.ll
+++ llvm/test/DebugInfo/X86/implicit_value-double.ll
@@ -9,6 +9,8 @@
; CHECK-NEXT: [{{.*}}): DW_OP_implicit_value 0x8 0x1f 0x85 0xeb 0x51 0xb8 0x1e 0x09 0x40)
; CHECK-NEXT: DW_AT_name ("d")
+; RUN: llc -debugger-tune=lldb -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s
+
;; Generated from: clang -ggdb -O1
;;int main() {
;; double d = 3.14;
Index: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2480,7 +2480,8 @@
DwarfExpr.addExpression(std::move(ExprCursor));
return;
} else if (Value.isConstantFP()) {
- if (AP.getDwarfVersion() >= 4 && AP.getDwarfDebug()->tuneForGDB()) {
+ if (AP.getDwarfVersion() >= 4 && (AP.getDwarfDebug()->tuneForGDB() ||
+ AP.getDwarfDebug()->tuneForLLDB())) {
DwarfExpr.addConstantFP(Value.getConstantFP()->getValueAPF(), AP);
return;
} else if (Value.getConstantFP()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90001.300439.patch
Type: text/x-patch
Size: 3306 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201024/0a26b7c8/attachment-0001.bin>
More information about the llvm-commits
mailing list