summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile
diff options
context:
space:
mode:
authorEd Maste <emaste@freebsd.org>2013-10-23 17:24:15 +0000
committerEd Maste <emaste@freebsd.org>2013-10-23 17:24:15 +0000
commit2ea0f2cdaef1d5c8a01acb2a9d9437215a0e0e00 (patch)
tree442b48c0a4f1d80a58ed97d7d7838a211390f229 /lldb/source/Plugins/SymbolFile
parent325ec89508dfae7af1f4eb48ab8fa034c763abf2 (diff)
downloadbcm5719-llvm-2ea0f2cdaef1d5c8a01acb2a9d9437215a0e0e00.tar.gz
bcm5719-llvm-2ea0f2cdaef1d5c8a01acb2a9d9437215a0e0e00.zip
64-Bit DWARF support for .debug_aranges and .debug_pubnames
llvm-svn: 193250
Diffstat (limited to 'lldb/source/Plugins/SymbolFile')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp13
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp17
2 files changed, 26 insertions, 4 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
index b1eb27299ef..7dc32127313 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
@@ -183,9 +183,20 @@ DWARFDebugArangeSet::Extract(const DataExtractor &data, lldb::offset_t *offset_p
// descriptor on the target system. This header is followed by a series
// of tuples. Each tuple consists of an address and a length, each in
// the size appropriate for an address on the target architecture.
+ size_t dwarf_offset_size = 4;
m_header.length = data.GetU32(offset_ptr);
+ if (m_header.length == 0xffffffff)
+ {
+ dwarf_offset_size = 8;
+ m_header.length = data.GetU64(offset_ptr);
+ }
+ else if (m_header.length >= 0xffffff00)
+ {
+ // Reserved.
+ return false;
+ }
m_header.version = data.GetU16(offset_ptr);
- m_header.cu_offset = data.GetU32(offset_ptr);
+ m_header.cu_offset = data.GetMaxU64(offset_ptr, dwarf_offset_size);
m_header.addr_size = data.GetU8(offset_ptr);
m_header.seg_size = data.GetU8(offset_ptr);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp
index 2df8d525f03..7f8327d7fc1 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp
@@ -84,15 +84,26 @@ DWARFDebugPubnamesSet::Extract(const DataExtractor& data, lldb::offset_t *offset
{
m_descriptors.clear();
m_offset = *offset_ptr;
+ size_t dwarf_offset_size = 4;
m_header.length = data.GetU32(offset_ptr);
+ if (m_header.length == 0xffffffff)
+ {
+ dwarf_offset_size = 8;
+ m_header.length = data.GetU64(offset_ptr);
+ }
+ else if (m_header.length >= 0xffffff00)
+ {
+ // Reserved.
+ return false;
+ }
m_header.version = data.GetU16(offset_ptr);
- m_header.die_offset = data.GetU32(offset_ptr);
- m_header.die_length = data.GetU32(offset_ptr);
+ m_header.die_offset = data.GetMaxU64(offset_ptr, dwarf_offset_size);
+ m_header.die_length = data.GetMaxU64(offset_ptr, dwarf_offset_size);
Descriptor pubnameDesc;
while (data.ValidOffset(*offset_ptr))
{
- pubnameDesc.offset = data.GetU32(offset_ptr);
+ pubnameDesc.offset = data.GetMaxU64(offset_ptr, dwarf_offset_size);
if (pubnameDesc.offset)
{
OpenPOWER on IntegriCloud