[PATCH] D103502: [DebugInfo] Bug 41152 - Improve dumping of empty location expressions
Soham Dixit via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 28 02:16:46 PDT 2021
sohamdixit updated this revision to Diff 354813.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103502/new/
https://reviews.llvm.org/D103502
Files:
llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
llvm/test/DebugInfo/X86/dwarf-empty-expression.s
llvm/test/MC/X86/dwarf-size-field-overflow.test
Index: llvm/test/MC/X86/dwarf-size-field-overflow.test
===================================================================
--- llvm/test/MC/X86/dwarf-size-field-overflow.test
+++ llvm/test/MC/X86/dwarf-size-field-overflow.test
@@ -6,7 +6,7 @@
#
# CHECK: 0x0000004d: DW_TAG_formal_parameter
# CHECK-NEXT: DW_AT_location (0x00000000
-# CHECK-NEXT: [0x0000000000000000, 0x0000000000000008): )
+# CHECK-NEXT: [0x0000000000000000, 0x0000000000000008): <empty>)
# CHECK-NEXT: DW_AT_name ("self")
import sys
Index: llvm/test/DebugInfo/X86/dwarf-empty-expression.s
===================================================================
--- /dev/null
+++ llvm/test/DebugInfo/X86/dwarf-empty-expression.s
@@ -0,0 +1,23 @@
+# RUN: llvm-mc -triple x86_64-unknown-linux -filetype=obj %s -o %t.o
+# RUN: llvm-dwarfdump %t.o --debug-loclists | FileCheck %s
+
+# CHECK: DW_LLE_offset_pair (0x0000000000000000, 0x0000000000000000): <empty>
+
+.Lfunc_begin0:
+.Ltmp1:
+.section .debug_loclists, "", at progbits
+ .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
+.Ldebug_list_header_start0:
+ .short 5 # Version
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+ .long 1 # Offset entry count
+.Lloclists_table_base0:
+ .long .Ldebug_loc0-.Lloclists_table_base0
+.Ldebug_loc0:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp1-.Lfunc_begin0 # ending offset
+ .byte 0 ### empty
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_list_header_end0:
Index: llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
@@ -326,6 +326,9 @@
bool IsEH) const {
uint32_t EntryValExprSize = 0;
uint64_t EntryValStartOffset = 0;
+ if (Data.getData().empty())
+ OS << "<empty>";
+
for (auto &Op : *this) {
if (!Op.print(OS, DumpOpts, this, RegInfo, U, IsEH)) {
uint64_t FailOffset = Op.getEndOffset();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103502.354813.patch
Type: text/x-patch
Size: 2422 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210628/e7efff40/attachment.bin>
More information about the llvm-commits
mailing list