forked from OSchip/llvm-project
Allow searching for a section by SectionType.
llvm-svn: 109040
This commit is contained in:
parent
6238c1d102
commit
70e33eb06e
|
@ -54,6 +54,9 @@ public:
|
|||
lldb::SectionSP
|
||||
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;
|
||||
|
||||
|
@ -254,7 +257,7 @@ public:
|
|||
GetLinkedFileAddress () const;
|
||||
|
||||
lldb::SectionType
|
||||
GetSectionType () const
|
||||
GetType () const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue