Skip to content

Commit

Permalink
[DWARF] Print leading zeros in type signature
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296663 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
pogo59 committed Mar 1, 2017
1 parent 858e806 commit 859385d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void DWARFTypeUnit::dump(raw_ostream &OS, bool SummarizeTypes) {

if (SummarizeTypes) {
OS << "name = '" << Name << "'"
<< " type_signature = " << format("0x%16" PRIx64, TypeHash)
<< " type_signature = " << format("0x%016" PRIx64, TypeHash)
<< " length = " << format("0x%08x", getLength()) << '\n';
return;
}
Expand All @@ -46,7 +46,7 @@ void DWARFTypeUnit::dump(raw_ostream &OS, bool SummarizeTypes) {
OS << " abbr_offset = " << format("0x%04x", getAbbreviations()->getOffset())
<< " addr_size = " << format("0x%02x", getAddressByteSize())
<< " name = '" << Name << "'"
<< " type_signature = " << format("0x%16" PRIx64, TypeHash)
<< " type_signature = " << format("0x%016" PRIx64, TypeHash)
<< " type_offset = " << format("0x%04x", TypeOffset)
<< " (next unit at " << format("0x%08x", getNextUnitOffset()) << ")\n";

Expand Down
Binary file modified test/DebugInfo/Inputs/dwarfdump-header.elf-x86-64
Binary file not shown.
2 changes: 1 addition & 1 deletion test/DebugInfo/Inputs/dwarfdump-header.s
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ TU_4_version:
.short 4 # DWARF version number
.long .debug_abbrev # Offset Into Abbrev. Section
.byte 8 # Address Size (in bytes)
.quad 0x1122334455667788 # Type Signature
.quad 0x0011223344556677 # Type Signature
.long TU_4_type-TU_4_start # Type offset
# The type-unit DIE, which has a name.
.byte 2
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/dwarfdump-header.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CHECK-LABEL: .debug_types contents:

The v4 type unit header.

CHECK: 0x00000000: Type Unit: length = 0x0000001f version = 0x0004 abbr_offset = 0x0000 addr_size = 0x08 name = 'V4_type_unit' type_signature = 0x1122334455667788 type_offset = 0x001c (next unit at 0x00000023)
CHECK: 0x00000000: Type Unit: length = 0x0000001f version = 0x0004 abbr_offset = 0x0000 addr_size = 0x08 name = 'V4_type_unit' type_signature = 0x0011223344556677 type_offset = 0x001c (next unit at 0x00000023)
CHECK: 0x00000017: DW_TAG_type_unit

FIXME: DWARF v5 wants type units in .debug_info[.dwo] not .debug_types[.dwo].
Expand Down

0 comments on commit 859385d

Please sign in to comment.