Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
LLDB
Khoa Pham
August 27, 2015
Programming
0
68
LLDB
Tips on using LLDB
Khoa Pham
August 27, 2015
Tweet
Share
More Decks by Khoa Pham
See All by Khoa Pham
onmyway133
0
95
onmyway133
0
62
onmyway133
0
100
onmyway133
2
180
onmyway133
0
63
onmyway133
4
89
onmyway133
1
210
onmyway133
0
100
onmyway133
0
160
Other Decks in Programming
See All in Programming
yattom
30
10k
tarappo
4
390
manfredsteyer
PRO
0
140
yosuke_furukawa
PRO
1
220
imk2o
0
180
o0h
PRO
3
1.5k
ottijp
0
180
scrpgil
0
100
tooppoo
1
440
dora1998
0
160
77web
2
2.3k
nori0__
1
480
Featured
See All Featured
philhawksworth
192
8.9k
qrush
285
19k
sachag
445
36k
brad_frost
157
6.5k
shpigford
370
42k
paulrobertlloyd
72
1.5k
jrom
116
7.2k
brianwarren
82
4.8k
morganepeng
19
1.3k
geoffreycrofte
25
1k
addyosmani
494
110k
bryan
32
3.5k
Transcript
LLDB Khoa Pham - 2359 Media
LLDB Home page http://lldb.llvm.org/ LLDB is an open-source debugger that
features a REPL, along with C++ and Python plugins
Menu - Command - Use cases - Python - Chisel
- Standalone
Command
Command - help Information on any command help print help
thread continue help help
Command - print Print value print a print self
Command Prefix matching print, prin, pri, p expression, e Can’t
use pr (print or process?)
Command $ variable Anything starting with a dollar sign is
in LLDB’ s namespace and exists to help you print $0 + 7
Command - expression Evaluate an expression (ObjC++ or Swift) in
the current program context, Modify values in the program expression $0 = 10 e $0 = 10
Command - print 'print' is an abbreviation for 'expression --'.
Use -- to signify the end of the flags and the beginning of the input e --location -- -count
Command - print object See the description method of an
object e -O -- aString po aString
Command - variable The variable must start with a dollar
sign e NSInteger $b = 10; p $b + a
Command - flow Continue process continue, continue, c Step over
thread step-over, next, n
Command - flow Step into thread step-in, step, s Step
out thread step-out, finish
Command - thread return Executes the return command, jumping out
of the current stack frame thread return YES
Breakpoint List breakpoints br li Create breakpoints br set -f
ViewController.m 39
Use cases Find targets of a button po [self.myButton allTargets]
Use cases See the frame po self.view.frame e @import UIKit
po self.view.frame
Use cases Change background color without continue e self.view.backgroundColor =
[UIColor greenColor] e (void)[CATransaction flush]
Use cases Watch variable wivar self _number
Python LLDB has full, built-in Python support. If you type
script in LLDB, it will open a Python REPL
.lldbinit Executed every time LLDB starts command script import /path/to/fblldb.py
Chisel brew update brew install chisel # ~/.lldbinit command script
import /path/to/fblldb.py
Standalone Using LLDB as a Standalone Debugger
References - Getting Started with LLDB - Dancing in the
Debugger — A Waltz with LLDB - Video Tutorial: Using LLDB in iOS - Navigating and discovering an iOS codebase using lldb - chisel