The lldb expr
command evaluates a C/ObjC/C++ expression in the current program context, using user defined variables and variables currently in scope.
Examples:
expr -- functionB(17) expr -- [self methodB]
Sometimes it is necessary to specify the return value explicitly, for example
expr -- (void)functionB(17)
If the function returns an Objective-C object then you can use po
as an alias
for expression -O --
, in that case lldb prints the description
of the return value.
You can also add the debugger command as an "Action" to the breakpoint, to have it executed automatically when the breakpoint is hit: