-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[LLDB] Add a child property to compliment the existing parent property #168619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-lldb Author: Jacob Lalonde (Jlalond) ChangesI've been working on some scripts that evaluate the parent and child frame. It's been very annoying that the parent frame has a property but not the child. So I've added this to the extensions, I would've preferred to return None, but because the existing impl returns an invalid SBFrame, so I'm conforming to that API. Full diff: https://github.com/llvm/llvm-project/pull/168619.diff 1 Files Affected:
diff --git a/lldb/bindings/interface/SBFrameExtensions.i b/lldb/bindings/interface/SBFrameExtensions.i
index 38d03abaee8f0..0c79b98b290f2 100644
--- a/lldb/bindings/interface/SBFrameExtensions.i
+++ b/lldb/bindings/interface/SBFrameExtensions.i
@@ -24,6 +24,13 @@ STRING_EXTENSION_OUTSIDE(SBFrame)
else:
return SBFrame()
+ def get_child_frame(self):
+ child_idx = self.idx - 1
+ if child_idx >= 0:
+ return self.thread.frame[child_idx]
+ else:
+ return SBFrame()
+
def get_arguments(self):
return self.GetVariables(True,False,False,False)
@@ -92,6 +99,7 @@ STRING_EXTENSION_OUTSIDE(SBFrame)
register = 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.''')
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''')
parent = property(get_parent_frame, None, doc='''A read only property that returns the parent (caller) frame of the current frame.''')
+ child = property(get_child_frame, None, doc='''A read only property that returns the child (callee) frame of the current frame.''')
%}
#endif
}
|
🐧 Linux x64 Test Results
|
jimingham
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Apparently we don't test that these property affordances at all, so far as I can see. We really should do that, but given nobody else has it seems unfair to require it for this patch...
Opened an issue #168920, end of the year will be very busy for me personally but I will also look into adding more tests in the future! |
I've been working on some scripts that evaluate the parent and child frame. It's been very annoying that the parent frame has a property but not the child. So I've added this to the extensions, I would've preferred to return None, but because the existing impl returns an invalid SBFrame, so I'm conforming to that API.