Sean Callanan
- lldb commands
ti
/thread info
EXC_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 1
p 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) repl
when your app is running- add code to an existing session(!)
:
to get back to LLDB:help
to issue LLDB commands directly from the repl
-
$ xcrun swift
in any shell -
The REPL adds global code
-
use
expression
command for investigating stack variables -
use
LLDB REPL
for global variables, classes, functions -
See Advanced Debugging with LLDB 2013 video