[Lldb-commits] [lldb] r147330 - in /lldb/trunk: include/lldb/Symbol/DWARFCallFrameInfo.h source/Symbol/DWARFCallFrameInfo.cpp

Greg Clayton gclayton at apple.com
Wed Dec 28 16:05:27 PST 2011


Author: gclayton
Date: Wed Dec 28 18:05:26 2011
New Revision: 147330

URL: http://llvm.org/viewvc/llvm-project?rev=147330&view=rev
Log:
Centralize the code the reads the CFI so that we always log.


Modified:
    lldb/trunk/include/lldb/Symbol/DWARFCallFrameInfo.h
    lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp

Modified: lldb/trunk/include/lldb/Symbol/DWARFCallFrameInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/DWARFCallFrameInfo.h?rev=147330&r1=147329&r2=147330&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/DWARFCallFrameInfo.h (original)
+++ lldb/trunk/include/lldb/Symbol/DWARFCallFrameInfo.h Wed Dec 28 18:05:26 2011
@@ -113,6 +113,9 @@
 
     const CIE* 
     GetCIE(dw_offset_t cie_offset);
+    
+    void
+    GetCFIData();
 
     ObjectFile&                 m_objfile;
     lldb::SectionSP             m_section;

Modified: lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp?rev=147330&r1=147329&r2=147330&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp (original)
+++ lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp Wed Dec 28 18:05:26 2011
@@ -118,10 +118,7 @@
     CIESP cie_sp(new CIE(cie_offset));
     dw_offset_t offset = cie_offset;
     if (m_cfi_data_initialized == false)
-    {
-        m_section->ReadSectionDataFromObjectFile (&m_objfile, m_cfi_data);
-        m_cfi_data_initialized = true;
-    }
+        GetCFIData();
     const uint32_t length = m_cfi_data.GetU32(&offset);
     const dw_offset_t cie_id = m_cfi_data.GetU32(&offset);
     const dw_offset_t end_offset = cie_offset + length + 4;
@@ -274,6 +271,18 @@
     return cie_sp;
 }
 
+void
+DWARFCallFrameInfo::GetCFIData()
+{
+    if (m_cfi_data_initialized == false)
+    {
+        LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND));
+        if (log)
+            m_objfile.GetModule()->LogMessage(log.get(), "Reading EH frame info");
+        m_section->ReadSectionDataFromObjectFile (&m_objfile, m_cfi_data);
+        m_cfi_data_initialized = true;
+    }
+}
 // Scan through the eh_frame or debug_frame section looking for FDEs and noting the start/end addresses
 // of the functions and a pointer back to the function's FDE for later expansion.
 // Internalize CIEs as we come across them.
@@ -289,15 +298,7 @@
 
     dw_offset_t offset = 0;
     if (m_cfi_data_initialized == false)
-    {
-        LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND));
-        if (log)
-        { 
-            log->Printf ("Reading eh_frame information for %s", m_objfile.GetFileSpec().GetFilename().GetCString());
-        }
-        m_section->ReadSectionDataFromObjectFile (&m_objfile, m_cfi_data);
-        m_cfi_data_initialized = true;
-    }
+        GetCFIData();
     while (m_cfi_data.ValidOffsetForDataOfSize (offset, 8))
     {
         const dw_offset_t current_entry = offset;
@@ -350,10 +351,7 @@
         return false;
 
     if (m_cfi_data_initialized == false)
-    {
-        m_section->ReadSectionDataFromObjectFile (&m_objfile, m_cfi_data);
-        m_cfi_data_initialized = true;
-    }
+        GetCFIData();
 
     uint32_t length = m_cfi_data.GetU32 (&offset);
     dw_offset_t cie_offset = m_cfi_data.GetU32 (&offset);





More information about the lldb-commits mailing list