ios - Capture `UIImageView` properties with lldb and python -
i trying use lldb , python debug view hierarchy. when set breakpoint in xcode , explore frame value like:
expr @import uikit po self.imageview.frame
lldb able execute command shown:
when try replicate same command using python scripting so:
import lldb lldb.debugger.handlecommand('expr @import uikit') expression = 'self.imageview.frame' frame = lldb.debugger.getselectedtarget().getprocess().getselectedthread().getselectedframe() expr_options = lldb.sbexpressionoptions() language = frame.getcompileunit().getlanguage() expr_options.setlanguage(language) value = frame.evaluateexpression(expression, expr_options)
the value of expression value.getvalue()
none
.
how value of self.imageview.frame
using lldb python scripting can further computations on value in python?
frame
aggregate type (a structure or class object) , aggregate types don't have values since aren't particular unitary thing...
they have summaries - pretty printed text rendition of contents of aggregate type - can access sbvalue::getsummary
. note, these summaries provided lldb's data formatter mechanism, same mechanism used in normal variable printing, , example provides seeing in po result.. if want emulate kind of printing command line, summary want.
sbvalues representing aggregate types have members - that's "real" contents of value. in sbvalue parlance these called children, , can access them via sbvalue api's (e.g. sbvalue::getnumchildren
& sbvalue::getchildatindex
.)
Comments
Post a Comment