diff options
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp | 9 | ||||
| -rw-r--r-- | llvm/test/DebugInfo/X86/dwarfdump-debug-loclists.test | 12 |
2 files changed, 12 insertions, 9 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp index bfcf799d230..b4bdaaac0c2 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp @@ -227,13 +227,16 @@ void DWARFDebugLoclists::LocationList::dump(raw_ostream &OS, uint64_t BaseAddr, case dwarf::DW_LLE_start_length: OS << '\n'; OS.indent(Indent); - OS << format("[0x%8.8x, 0x%8.8x): ", E.Value0, E.Value0 + E.Value1); + OS << format("[0x%*.*" PRIx64 ", 0x%*.*x): ", AddressSize * 2, + AddressSize * 2, E.Value0, AddressSize * 2, AddressSize * 2, + E.Value0 + E.Value1); break; case dwarf::DW_LLE_offset_pair: OS << '\n'; OS.indent(Indent); - OS << format("[0x%8.8x, 0x%8.8x): ", BaseAddr + E.Value0, - BaseAddr + E.Value1); + OS << format("[0x%*.*" PRIx64 ", 0x%*.*x): ", AddressSize * 2, + AddressSize * 2, BaseAddr + E.Value0, AddressSize * 2, + AddressSize * 2, BaseAddr + E.Value1); break; case dwarf::DW_LLE_base_address: BaseAddr = E.Value0; diff --git a/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists.test b/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists.test index de8cb15596a..e5f7fb0c1c1 100644 --- a/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists.test +++ b/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists.test @@ -4,16 +4,16 @@ # CHECK: .debug_info # CHECK: DW_AT_name{{.*}}"stub" # CHECK: DW_AT_location [DW_FORM_sec_offset] (0x0000000c -# CHECK-NEXT: [0x00000010, 0x00000020): DW_OP_breg5 RDI+0 -# CHECK-NEXT: [0x00000530, 0x00000540): DW_OP_breg6 RBP-8, DW_OP_deref -# CHECK-NEXT: [0x00000700, 0x00000710): DW_OP_breg5 RDI+0 +# CHECK-NEXT: [0x0000000000000010, 0x0000000000000020): DW_OP_breg5 RDI+0 +# CHECK-NEXT: [0x0000000000000530, 0x0000000000000540): DW_OP_breg6 RBP-8, DW_OP_deref +# CHECK-NEXT: [0x0000000000000700, 0x0000000000000710): DW_OP_breg5 RDI+0 # CHECK: .debug_loclists contents: # CHECK-NEXT: 0x00000000: locations list header: length = 0x00000031, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000 # CHECK-NEXT: 0x00000000: -# CHECK-NEXT: [0x00000000, 0x00000010): DW_OP_breg5 RDI+0 -# CHECK-NEXT: [0x00000530, 0x00000540): DW_OP_breg6 RBP-8, DW_OP_deref -# CHECK-NEXT: [0x00000700, 0x00000710): DW_OP_breg5 RDI+0 +# CHECK-NEXT: [0x0000000000000000, 0x0000000000000010): DW_OP_breg5 RDI+0 +# CHECK-NEXT: [0x0000000000000530, 0x0000000000000540): DW_OP_breg6 RBP-8, DW_OP_deref +# CHECK-NEXT: [0x0000000000000700, 0x0000000000000710): DW_OP_breg5 RDI+0 .section .debug_str,"MS",@progbits,1 .asciz "stub" |

