Created
February 20, 2015 10:55
-
-
Save berikv/73b10288c87922fa0a2f to your computer and use it in GitHub Desktop.
LLDB helper for printing the position of a view inside it's window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (lldb) posinwindow 0x796a0e60 | |
| (CGPoint) $58 = (x=711, y=205.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import lldb | |
| import fblldbbase as fb | |
| def lldbcommands(): | |
| return [ PrintPositionInWindow() ] | |
| class PrintPositionInWindow(fb.FBCommand): | |
| def name(self): | |
| return 'posinwindow' | |
| def description(self): | |
| return """Returns the position of this view in it's current window""" | |
| def run(self, arguments, options): | |
| view = arguments[0] | |
| lldb.debugger.HandleCommand('p (CGPoint)[(UIView *)%s convertPoint:((CGRect)[(UIView *)%s bounds]).origin toView:(UIWindow *)[(UIView *)%s window]]' % (view, view, view)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment