Advanced Debugging With Xcode and LLDB

Sellen Wei
1 min readJun 28, 2018

--

  1. frame variable varaibleName

print out the type of this variable

2. expression variableBool = false

add an break point, add action for this break point, then it will change the variableBool to false

3. add break point for all places that call this function: symbolic breakpoint

4. po $arg1 — — print assembly code

5. breakpoint set — one-shot true — name “-[UILabel setText:]” : break point valid for only once

6. skip the line by dragging the break point to next line or add break point and add action: thread jump — by 1

7.monitor variable by right click on variable name and click watch variable name

8.expression -l objc -O — —[‘self.view’ XXXX] to fix the error that certain type has no member

9. command alias poc expression -l objc -O — —

alias complicate command with easier one

video reference: https://developer.apple.com/videos/play/wwdc2018/412/

What is LLDB?

It’s the debugger of The LLVM Compiler Infrastructure. Here is the homepage and this is a good article about it: Dancing in the Debugger — A Waltz with LLDB.

--

--