[Lldb-commits] [lldb] r193250 - 64-Bit DWARF support for .debug_aranges and .debug_pubnames

Ed Maste emaste at freebsd.org
Wed Oct 23 10:24:15 PDT 2013


Author: emaste
Date: Wed Oct 23 12:24:15 2013
New Revision: 193250

URL: http://llvm.org/viewvc/llvm-project?rev=193250&view=rev
Log:
64-Bit DWARF support for .debug_aranges and .debug_pubnames


Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp?rev=193250&r1=193249&r2=193250&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp Wed Oct 23 12:24:15 2013
@@ -183,9 +183,20 @@ DWARFDebugArangeSet::Extract(const DataE
         // 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);
 

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp?rev=193250&r1=193249&r2=193250&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp Wed Oct 23 12:24:15 2013
@@ -84,15 +84,26 @@ DWARFDebugPubnamesSet::Extract(const Dat
     {
         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)
             {





More information about the lldb-commits mailing list