[Lldb-commits] [lldb] r193407 - Update DWARFDebugPubnamesSet 64-bit DWARF to use new DWARFDataExtractor

Ed Maste emaste at freebsd.org
Fri Oct 25 06:18:17 PDT 2013


Author: emaste
Date: Fri Oct 25 08:18:17 2013
New Revision: 193407

URL: http://llvm.org/viewvc/llvm-project?rev=193407&view=rev
Log:
Update DWARFDebugPubnamesSet 64-bit DWARF to use new DWARFDataExtractor


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

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=193407&r1=193406&r2=193407&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp Fri Oct 25 08:18:17 2013
@@ -84,26 +84,15 @@ DWARFDebugPubnamesSet::Extract(const DWA
     {
         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.length     = data.GetDWARFInitialLength(offset_ptr);
         m_header.version    = data.GetU16(offset_ptr);
-        m_header.die_offset = data.GetMaxU64(offset_ptr, dwarf_offset_size);
-        m_header.die_length = data.GetMaxU64(offset_ptr, dwarf_offset_size);
+        m_header.die_offset = data.GetDWARFOffset(offset_ptr);
+        m_header.die_length = data.GetDWARFOffset(offset_ptr);
 
         Descriptor pubnameDesc;
         while (data.ValidOffset(*offset_ptr))
         {
-            pubnameDesc.offset  = data.GetMaxU64(offset_ptr, dwarf_offset_size);
+            pubnameDesc.offset  = data.GetDWARFOffset(offset_ptr);
 
             if (pubnameDesc.offset)
             {





More information about the lldb-commits mailing list