Sean Callanan
- lldb commands
ti/thread infoEXC_BAD_INSTRUCTION= CPU doesn't understand an instruction- typically used in assertions -> Assertion failure
bt/thread backtrace- prints all frames on the stack of the current thread
f 1/frame select 1p foo/expression foo
- In Xcode, you can also see where blocks get dispatched
br s -r timestwo.*String- methods of a class:
-r Account\\. - Functions in a module:
-r main\\.
br co a\breakpoint command add>p valueInCents>continue>DONE
- Caveat: You must set separate conditions and actions for Obj-C and Swift locations
(lldb) br m --c "a[3]==2"3.1(lldb) br m --c "a[3]==2"3.1
-
(lldb) replwhen your app is running- add code to an existing session(!)
:to get back to LLDB:helpto issue LLDB commands directly from the repl
-
$ xcrun swiftin any shell -
The REPL adds global code
-
use
expressioncommand for investigating stack variables -
use
LLDB REPLfor global variables, classes, functions -
See Advanced Debugging with LLDB 2013 video