summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 10:51:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 10:51:19 +0000
commiteb11fae6d08f479c0799db45860a98af528fa6e7 (patch)
tree44d492a50c8c1a7eb8e2d17ea3360ec4d066f042 /lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp
parentb8a2042aa938069e862750553db0e4d82d25822c (diff)
Notes
Diffstat (limited to 'lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp')
-rw-r--r--lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp b/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp
index ed5d726ae4e2..b9ef6905912a 100644
--- a/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp
+++ b/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp
@@ -17,6 +17,13 @@
using namespace llvm;
+void DWARFDebugArangeSet::Descriptor::dump(raw_ostream &OS,
+ uint32_t AddressSize) const {
+ OS << format("[0x%*.*" PRIx64 ", ", AddressSize * 2, AddressSize * 2, Address)
+ << format(" 0x%*.*" PRIx64 ")", AddressSize * 2, AddressSize * 2,
+ getEndAddress());
+}
+
void DWARFDebugArangeSet::clear() {
Offset = -1U;
std::memset(&HeaderData, 0, sizeof(Header));
@@ -98,10 +105,8 @@ void DWARFDebugArangeSet::dump(raw_ostream &OS) const {
<< format("cu_offset = 0x%8.8x, addr_size = 0x%2.2x, seg_size = 0x%2.2x\n",
HeaderData.CuOffset, HeaderData.AddrSize, HeaderData.SegSize);
- const uint32_t hex_width = HeaderData.AddrSize * 2;
for (const auto &Desc : ArangeDescriptors) {
- OS << format("[0x%*.*" PRIx64 " -", hex_width, hex_width, Desc.Address)
- << format(" 0x%*.*" PRIx64 ")\n",
- hex_width, hex_width, Desc.getEndAddress());
+ Desc.dump(OS, HeaderData.AddrSize);
+ OS << '\n';
}
}