[Lldb-commits] [lldb] r109040 - in /lldb/trunk: include/lldb/Core/Section.h source/Core/Address.cpp source/Core/Section.cpp

Greg Clayton gclayton at apple.com
Wed Jul 21 14:49:46 PDT 2010


Author: gclayton
Date: Wed Jul 21 16:49:46 2010
New Revision: 109040

URL: http://llvm.org/viewvc/llvm-project?rev=109040&view=rev
Log:
Allow searching for a section by SectionType.

Modified:
    lldb/trunk/include/lldb/Core/Section.h
    lldb/trunk/source/Core/Address.cpp
    lldb/trunk/source/Core/Section.cpp

Modified: lldb/trunk/include/lldb/Core/Section.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Section.h?rev=109040&r1=109039&r2=109040&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Section.h (original)
+++ lldb/trunk/include/lldb/Core/Section.h Wed Jul 21 16:49:46 2010
@@ -55,6 +55,9 @@
     FindSectionByID (lldb::user_id_t sect_id) const;
 
     lldb::SectionSP
+    FindSectionByType (lldb::SectionType sect_type, uint32_t start_idx = 0) const;
+
+    lldb::SectionSP
     GetSharedPointer (const Section *section, bool check_children) const;
 
     lldb::SectionSP
@@ -254,7 +257,7 @@
     GetLinkedFileAddress () const;
 
     lldb::SectionType
-    GetSectionType () const
+    GetType () const
     {
         return m_type;
     }

Modified: lldb/trunk/source/Core/Address.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Address.cpp?rev=109040&r1=109039&r2=109040&view=diff
==============================================================================
--- lldb/trunk/source/Core/Address.cpp (original)
+++ lldb/trunk/source/Core/Address.cpp Wed Jul 21 16:49:46 2010
@@ -508,7 +508,7 @@
             const Section *section = GetSection();
             if (section)
             {
-                SectionType sect_type = section->GetSectionType();
+                SectionType sect_type = section->GetType();
                 switch (sect_type)
                 {
                 case eSectionTypeDataCString:

Modified: lldb/trunk/source/Core/Section.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Section.cpp?rev=109040&r1=109039&r2=109040&view=diff
==============================================================================
--- lldb/trunk/source/Core/Section.cpp (original)
+++ lldb/trunk/source/Core/Section.cpp Wed Jul 21 16:49:46 2010
@@ -566,6 +566,23 @@
     return sect_sp;
 }
 
+
+SectionSP
+SectionList::FindSectionByType (lldb::SectionType sect_type, uint32_t start_idx) const
+{
+    SectionSP sect_sp;
+    uint32_t num_sections = m_sections.size();
+    for (uint32_t idx = start_idx; idx < num_sections; ++idx)
+    {
+        if (m_sections[idx]->GetType() == sect_type)
+        {
+            sect_sp = m_sections[idx];
+            break;
+        }
+    }
+    return sect_sp;
+}
+
 SectionSP
 SectionList::GetSharedPointer (const Section *section, bool check_children) const
 {





More information about the lldb-commits mailing list