1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[DebugInfo] Do not dump header field for pre-DWARFv5 address tables.

As there is no header in pre-DWARFv5 address tables, and we fill
the class data members with some artificial values, we should not
dump them as that might be misleading.

Differential Revision: https://reviews.llvm.org/D74195
This commit is contained in:
Igor Kudrin 2020-02-06 20:34:10 +07:00
parent aba0bf1de0
commit 80d0555a9c
3 changed files with 7 additions and 8 deletions

View File

@ -138,11 +138,12 @@ Error DWARFDebugAddrTable::extract(DWARFDataExtractor Data,
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"

View File

@ -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

View File

@ -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