summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Core/Section.h5
-rw-r--r--lldb/source/Core/Address.cpp2
-rw-r--r--lldb/source/Core/Section.cpp17
3 files changed, 22 insertions, 2 deletions
diff --git a/lldb/include/lldb/Core/Section.h b/lldb/include/lldb/Core/Section.h
index 3b3e43d4af3..f88df65dbb1 100644
--- a/lldb/include/lldb/Core/Section.h
+++ b/lldb/include/lldb/Core/Section.h
@@ -55,6 +55,9 @@ public:
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 @@ public:
GetLinkedFileAddress () const;
lldb::SectionType
- GetSectionType () const
+ GetType () const
{
return m_type;
}
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp
index c3cb88ec065..97595326b34 100644
--- a/lldb/source/Core/Address.cpp
+++ b/lldb/source/Core/Address.cpp
@@ -508,7 +508,7 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum
const Section *section = GetSection();
if (section)
{
- SectionType sect_type = section->GetSectionType();
+ SectionType sect_type = section->GetType();
switch (sect_type)
{
case eSectionTypeDataCString:
diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp
index 89549f002ab..e4617a8ee99 100644
--- a/lldb/source/Core/Section.cpp
+++ b/lldb/source/Core/Section.cpp
@@ -566,6 +566,23 @@ SectionList::FindSectionByID (user_id_t sect_id) const
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
{
OpenPOWER on IntegriCloud