summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/API/SBSection.h6
-rw-r--r--lldb/scripts/Python/interface/SBSection.i3
-rw-r--r--lldb/source/API/SBSection.cpp14
3 files changed, 22 insertions, 1 deletions
diff --git a/lldb/include/lldb/API/SBSection.h b/lldb/include/lldb/API/SBSection.h
index d1b127f1729..3386484f649 100644
--- a/lldb/include/lldb/API/SBSection.h
+++ b/lldb/include/lldb/API/SBSection.h
@@ -33,7 +33,10 @@ public:
const char *
GetName ();
-
+
+ lldb::SBSection
+ GetParent();
+
lldb::SBSection
FindSubSection (const char *sect_name);
@@ -77,6 +80,7 @@ public:
bool
GetDescription (lldb::SBStream &description);
+
private:
friend class SBAddress;
diff --git a/lldb/scripts/Python/interface/SBSection.i b/lldb/scripts/Python/interface/SBSection.i
index cf41bdf2038..5bbf9ee10d5 100644
--- a/lldb/scripts/Python/interface/SBSection.i
+++ b/lldb/scripts/Python/interface/SBSection.i
@@ -54,6 +54,9 @@ public:
GetName ();
lldb::SBSection
+ GetParent();
+
+ lldb::SBSection
FindSubSection (const char *sect_name);
size_t
diff --git a/lldb/source/API/SBSection.cpp b/lldb/source/API/SBSection.cpp
index 354779984c3..3fb84e81465 100644
--- a/lldb/source/API/SBSection.cpp
+++ b/lldb/source/API/SBSection.cpp
@@ -69,6 +69,20 @@ SBSection::GetName ()
return NULL;
}
+lldb::SBSection
+SBSection::GetParent()
+{
+ lldb::SBSection sb_section;
+ SectionSP section_sp (GetSP());
+ if (section_sp)
+ {
+ SectionSP parent_section_sp (section_sp->GetParent());
+ if (parent_section_sp)
+ sb_section.SetSP(parent_section_sp);
+ }
+ return sb_section;
+}
+
lldb::SBSection
SBSection::FindSubSection (const char *sect_name)
OpenPOWER on IntegriCloud