[PATCH] D74195: [DebugInfo] Do not dump header field for pre-DWARF5 address tables.
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 11 22:37:05 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG675c4bebaffc: [DebugInfo] Do not dump header field for pre-DWARFv5 address tables. (authored by ikudrin).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74195/new/
https://reviews.llvm.org/D74195
Files:
llvm/lib/DebugInfo/DWARF/DWARFDebugAddr.cpp
llvm/test/DebugInfo/X86/debug_addr.ll
llvm/test/tools/llvm-dwarfdump/X86/debug_addr_dwarf4.s
Index: llvm/test/tools/llvm-dwarfdump/X86/debug_addr_dwarf4.s
===================================================================
--- llvm/test/tools/llvm-dwarfdump/X86/debug_addr_dwarf4.s
+++ llvm/test/tools/llvm-dwarfdump/X86/debug_addr_dwarf4.s
@@ -2,7 +2,6 @@
# RUN: llvm-dwarfdump --debug-addr %t.o | FileCheck %s
# CHECK: .debug_addr contents
-# CHECK-NEXT: length = 0x00000000, version = 0x0004, addr_size = 0x04, seg_size = 0x00
# CHECK-NEXT: Addrs: [
# CHECK-NEXT: 0x00000000
# CHECK-NEXT: 0x00000001
Index: llvm/test/DebugInfo/X86/debug_addr.ll
===================================================================
--- llvm/test/DebugInfo/X86/debug_addr.ll
+++ llvm/test/DebugInfo/X86/debug_addr.ll
@@ -22,7 +22,6 @@
; DWARF4: DW_TAG_GNU_call_site
; DWARF4: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000002) address = 0x0000000000000018 ".text")
; DWARF4: .debug_addr contents:
-; DWARF4-NEXT: 0x00000000: Addr Section: length = 0x00000000, version = 0x0004, addr_size = 0x04, seg_size = 0x00
; DWARF4-NEXT: Addrs: [
; DWARF4-NEXT: 0x00000000
; DWARF4-NEXT: 0x00000010
@@ -39,7 +38,7 @@
; DWARF5: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x0000000000000000 ".text")
; DWARF5: DW_AT_call_return_pc [DW_FORM_addrx] (indexed (00000002) address = 0x0000000000000018 ".text")
; DWARF5: .debug_addr contents:
-; DWARF5-NEXT: 0x00000000: Addr Section: length = 0x00000010, version = 0x0005, addr_size = 0x04, seg_size = 0x00
+; DWARF5-NEXT: 0x00000000: Address table header: length = 0x00000010, version = 0x0005, addr_size = 0x04, seg_size = 0x00
; DWARF5-NEXT: Addrs: [
; DWARF5-NEXT: 0x00000000
; DWARF5-NEXT: 0x00000010
Index: llvm/lib/DebugInfo/DWARF/DWARFDebugAddr.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFDebugAddr.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFDebugAddr.cpp
@@ -138,11 +138,12 @@
void DWARFDebugAddrTable::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const {
if (DumpOpts.Verbose)
OS << format("0x%8.8" PRIx32 ": ", HeaderOffset);
- OS << format("Addr Section: length = 0x%8.8" PRIx32
- ", version = 0x%4.4" PRIx16 ", "
- "addr_size = 0x%2.2" PRIx8 ", seg_size = 0x%2.2" PRIx8 "\n",
- HeaderData.Length, HeaderData.Version, HeaderData.AddrSize,
- HeaderData.SegSize);
+ if (HeaderData.Length)
+ OS << format("Address table header: length = 0x%8.8" PRIx32
+ ", version = 0x%4.4" PRIx16 ", "
+ "addr_size = 0x%2.2" PRIx8 ", seg_size = 0x%2.2" PRIx8 "\n",
+ HeaderData.Length, HeaderData.Version, HeaderData.AddrSize,
+ HeaderData.SegSize);
if (Addrs.size() > 0) {
const char *AddrFmt = (HeaderData.AddrSize == 4) ? "0x%8.8" PRIx64 "\n"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74195.244066.patch
Type: text/x-patch
Size: 2824 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200212/d6c3ff3b/attachment.bin>
More information about the llvm-commits
mailing list