summaryrefslogtreecommitdiffstats
path: root/lldb/scripts
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2015-06-16 21:07:52 +0000
committerEnrico Granata <egranata@apple.com>2015-06-16 21:07:52 +0000
commit84afb2156316ba6c05c6dca037ee7cd12b05ed3c (patch)
tree7c216ae0c8e2903056e2104de18189ea8622adde /lldb/scripts
parentb32684eb654ede7f242a4f9d8f209324bc954733 (diff)
downloadbcm5719-llvm-84afb2156316ba6c05c6dca037ee7cd12b05ed3c.tar.gz
bcm5719-llvm-84afb2156316ba6c05c6dca037ee7cd12b05ed3c.zip
Add a .parent property to SBFrame's Python interface which allows easy access to the caller frame of the current frame
llvm-svn: 239853
Diffstat (limited to 'lldb/scripts')
-rw-r--r--lldb/scripts/interface/SBFrame.i10
1 files changed, 10 insertions, 0 deletions
diff --git a/lldb/scripts/interface/SBFrame.i b/lldb/scripts/interface/SBFrame.i
index 5a5bbf483a8..2211dd103f9 100644
--- a/lldb/scripts/interface/SBFrame.i
+++ b/lldb/scripts/interface/SBFrame.i
@@ -273,6 +273,13 @@ public:
%pythoncode %{
def get_all_variables(self):
return self.GetVariables(True,True,True,True)
+
+ def get_parent_frame(self):
+ parent_idx = self.idx + 1
+ if parent_idx >= 0 and parent_idx < len(self.thread.frame):
+ return self.thread.frame[parent_idx]
+ else:
+ return SBFrame()
def get_arguments(self):
return self.GetVariables(True,False,False,False)
@@ -382,6 +389,9 @@ public:
__swig_getmethods__["reg"] = get_registers_access
if _newclass: reg = property(get_registers_access, None, doc='''A read only property that returns an helper object providing a flattened indexable view of the CPU registers for this stack frame''')
+ __swig_getmethods__["parent"] = get_parent_frame
+ if _newclass: parent = property(get_parent_frame, None, doc='''A read only property that returns the parent (caller) frame of the current frame.''')
+
%}
};
OpenPOWER on IntegriCloud