SlideShare a Scribd company logo
More Than Po:
Debugging In
lldb
@MicheleTitolo
Lead Software Engineer @ Capital One
lldb
What We’ll Cover
• LLDB basics
• Advanced thread, breakpoint,
watchpoint debugging
• Debugging with script
Lldb Commands
frame lang == lldb lang
Swift!
Basics
po
expr -O --
(lldb) po self.myCar
<Car: 0x7fc8206334d0>
(lldb) po self.canChangeGearTo(gear: Gear.Park)
true
-description
(lldb) po self.myCar
2014 Tesla S UIDeviceRGBColorSpace 0 0 1 1
p
expr --
(lldb) p self.myCar.year
(NSInteger) $1 = 2014
(lldb) p *self.myCar
(Car) $1 = {

NSObject = {

isa = Car

}

_running = NO

_make = 0x000000010077d088 @"Tesla"

_model = 0x000000010077d0a8 @"S"

_year = 2014

_color = 0x00007fd531eb9e30

_gear = Park

}
(lldb) po self.myCar
<SwiftCars.Car: 0x7fe8bb456a60>

(lldb) p *self.myCar
error: <EXPR>:1:1: error: '*' is not a prefix unary operator

*self.myCar

^
use expr to modify
values at runtime
(lldb) po self.myCar

2014 Tesla S UIDeviceRGBColorSpace 0 0 1 1

(lldb) expr self.myCar.year = 2013
(NSInteger) $0 = 2013

(lldb) po self.myCar

2013 Tesla S UIDeviceRGBColorSpace 0 0 1 1
frame variable
fr v
(lldb) fr v
(ViewController *) self = 0x00007f9628520cd0

(SEL) _cmd = "updateTipLabelsForBillAmount:"

(float) billAmount = 33

(float) tipPercentage = 0.200000003

(float) tipAmount = 6.5999999

(float) total = 39.5999985
(lldb) fr v -F self.myCar
self.myCar = 0x00007fe8bb456a60

self.myCar =

self.myCar.isa = SwiftCars.Car

self.myCar.make._core._owner = nil

self.myCar.model._core._owner = nil

self.myCar.color = 0x00007fe8bb452c80

self.myCar.color.isa = UICachedDeviceRGBColor

self.myCar.color._systemColorName = 0x00007fe8bb4424c0
“blueColor"

self.myCar.color.redComponent = 0

self.myCar.color.greenComponent = 0

self.myCar.color.blueComponent = 1

self.myCar.color.alphaComponent = 1

self.myCar.color.cachedColor = 0x0000000000000000

self.myCar.color.cachedColorOnceToken = 0

bt
thread backtrace
(lldb) bt
* thread #1: tid = 0x66c2, 0x0000000101a90330 Cars`-
[ViewController viewDidLoad](self=0x00007fc3d2c21570,
_cmd=0x0000000102f21cfb) + 448 at ViewController.m:28, queue =
'com.apple.main-thread', stop reason = breakpoint 1.1

* frame #0: 0x0000000101a90330 Cars`-[ViewController
viewDidLoad](self=0x00007fc3d2c21570, _cmd=0x0000000102f21cfb) +
448 at ViewController.m:28

frame #1: 0x000000010284f090 UIKit`-[UIViewController
loadViewIfRequired] + 738

frame #2: 0x000000010284f28e UIKit`-[UIViewController view] +
27

frame #3: 0x000000010276b5e9 UIKit`-[UIWindow
addRootViewControllerViewIfPossible] + 58

frame #4: 0x000000010276b9af UIKit`-[UIWindow
_setHidden:forced:] + 247

step / s
next / n
thread step-out /
finish
continue / c
~/.lldbinit
settings set prompt [lldb]$
command alias bd breakpoint disable
command alias be breakpoint enable
command alias bdel breakpoint delete
command alias bcommand breakpoint command add
command alias commands breakpoint command list
process
(lldb) process attach -p 5416
Process 5416 stopped

* thread #1: tid = 0xe4b02, 0x0000000106e234de

libsystem_kernel.dylib`mach_msg_trap + 10, queue = 'com.apple.main

thread', stop reason = signal SIGSTOP

frame #0: 0x0000000106e234de libsystem_kernel.dylib`mach_msg_trap +

10

libsystem_kernel.dylib`mach_msg_trap:

-> 0x106e234de <+10>: retq

0x106e234df <+11>: nop



libsystem_kernel.dylib`mach_msg_overwrite_trap:

0x106e234e0 <+0>: movq %rcx, %r10

0x106e234e3 <+3>: movl $0x1000020, %eax



Executable module set to "/Users/michele/Library/Developer/CoreSimulator/Devices/
5304657F-1710-42A1-87CA-E5358E87F4C8/data/Containers/Bundle/Application/312BA401-3B1E-4A17-
B7E8-BAAAE13EC463/Cars.app/Cars".

Architecture set to: x86_64h-apple-ios.
(lldb) c
Process 5416 resuming
help
help breakpoint
help breakpoint
command
help breakpoint
command add
-h --help
Thread
thread info
(lldb) thread info
thread #1: tid = 0x66c2, 0x0000000101a90330 Cars`-[ViewController
viewDidLoad](self=0x00007fc3d2c21570, _cmd=0x0000000102f21cfb) +
448 at ViewController.m:28, queue = 'com.apple.main-thread', stop
reason = breakpoint 1.1
thread list
(lldb) thread list
Process 921 stopped

* thread #1: tid = 0x66c2, 0x0000000101a90330 Cars`-
[ViewController viewDidLoad](self=0x00007fc3d2c21570,
_cmd=0x0000000102f21cfb) + 448 at ViewController.m:28, queue =
'com.apple.main-thread', stop reason = breakpoint 1.1

thread #2: tid = 0x66da, 0x0000000104bcc232
libsystem_kernel.dylib`kevent64 + 10, queue =
'com.apple.libdispatch-manager'

thread #3: tid = 0x66dc, 0x0000000104bc651a
libsystem_kernel.dylib`semaphore_wait_trap + 10, queue =
'FBSSerialQueue'

thread #4: tid = 0x66dd, 0x0000000104bcb94a
libsystem_kernel.dylib`__workq_kernreturn + 10

thread #5: tid = 0x66de, 0x0000000104bcb94a
libsystem_kernel.dylib`__workq_kernreturn + 10

thread until
<linenum>
(lldb) thread until 31
Process 1615 resuming

(lldb)
thread return
<expr>
(lldb) thread return NO
(lldb) thread return [NSNumber numberWithInt:7]
(lldb) thread return @"Hello"
(lldb) thread return true
error: Error returning from frame 0 of thread 1: We only support
setting simple integer and float return types at present..
Breakpoints
breakpoint list
br list
(lldb) br list
Current breakpoints:

1: file = 'Cars/Car.m', line = 50, locations = 1, resolved = 1,
hit count = 0



1.1: where = Cars`-[Car changeGearTo:] + 52 at Car.m:50,
address = 0x00000001026fd4e4, resolved, hit count = 0 



2: file = 'Cars/ViewController.m', line = 31, locations = 1,
resolved = 1, hit count = 1



2.1: where = Cars`-[ViewController viewDidLoad] + 512 at
ViewController.m:31, address = 0x00000001026fcb40, resolved, hit
count = 1
br set
br modify
br delete
(lldb) br set -f ViewController.m -l 31
Breakpoint 2: where = Cars`-[ViewController viewDidLoad] +

512 at ViewController.m:31, address = 0x000000010e2bdb40
(lldb) br set -F "-[Car changeGearTo:]”
Breakpoint 3: where = Cars`-[Car changeGearTo:] + 20 at

Car.m:47, address = 0x00000001073ba4c4
(lldb) br set -F “SwiftCars.Car.changeGearTo(gear: Cars.Gear) -> ()”
Breakpoint 10: where = SwiftCars`SwiftCars.Car.changeGearTo(gear:
SwiftCars.Gear) -> () + 18 at ViewController.swift:35, address =
0x000000010c97e032
SwiftCars.Car.changeGearTo(gear: SwiftCars.Gear) -> ()
Module Name
Type
Function signature
Namespaced
SwiftCars.Car.increaseSpeedTo(speed: Swift.Int) -> ()
Built-in types are in the Swift module
br ~= b
(lldb) b ViewController.m:31
(lldb) br ViewController.m:31
error: command 'breakpoint' did not recognize 'ViewController .m:
31' as valid (subcommand might be invalid).
(lldb) b Car.m:63

Breakpoint 2: where = Cars`-[Car increaseSpeedTo:] + 118 at
Car.m:63, address = 0x0000000100b7a576

(lldb) br modify -c "speed==15" 2
(lldb) c

Process 3093 resuming

(lldb)
(lldb) br modify -c "speed==15 && self.gear==4” 2
(lldb) br modify -c "speed==15 && gear==Gear.Drive" 1
(lldb) br modify -c "speed==20 && [self canChangeGearTo:4]" 2
(lldb) br modify -c "speed==15 && self.gear==4" -i 17 2
-i <count> ( --ignore-count <count> )
Set the number of times this
breakpoint is skipped before stopping.
-i <count> ( --ignore-count <count> )
Set the minimum number of times this
breakpoint is skipped before stopping.
(lldb) br delete 2
1 breakpoints deleted; 0 breakpoint locations disabled.
br enable
br disable
(lldb) breakpoint disable 2
1 breakpoints disabled.


...

2: file = 'Cars/ViewController.m', line = 31, locations = 1
Options: disabled
(lldb) breakpoint enable 2
1 breakpoints enabled.

...

2: file = 'Cars/ViewController.m', line = 31, locations = 1,
resolved = 1, hit count = 1
br command
(lldb) br command add -o "fr v" 2
(lldb) fr v

(Car *) self = 0x00007fb59ad142b0

(SEL) _cmd = "changeGearTo:"

(Gear) gear = Neutral
(lldb) br command add 1
Enter your debugger command(s). Type 'DONE' to end.

> fr v

> continue

> DONE
(lldb) fr v

(Car *) self = 0x00007f8061625490

(SEL) _cmd = "changeGearTo:"

(Gear) gear = Reverse

(lldb) continue

Process 2068 resuming

Command #2 'continue' continued the target.
(lldb) br command list 3
Breakpoint 3:

Breakpoint commands:

fr v
(lldb) br command delete 3
Breakpoints Added In
Console Do Not Persist
Between Runs
Watchpoints
A Watchpoint Tracks
A Value Over Time
…Kind Of Like Kvo!
[self.myCar addObserver:self

forKeyPath:@"speed"

options:NSKeyValueObservingOptionNew

context:KVOContext];



- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
change:(NSDictionary *)change context:(void *)context

{

if (car.speed > 1000) {

NSLog(@"WHY AM I GOING SO FAST %ld",

(long)car.speed);

}

}
- (void)setSpeed:(NSInteger)speed
{
_speed = speed;
if (_speed > 1000) {
NSLog(@"WHY AM I GOING SO FAST %ld",
(long)_speed);
}
}
breakpoint: place
watchpoint: value
watchpoint set
watch set
(lldb) watch set var self.speed

error: "self" is a pointer and . was used to attempt to

access "speed". Did you mean "self->speed"?
(lldb) watch set var self->speed

error: "speed" is not a member of "(Car *const) self"
(lldb) watch set var _speed
(lldb) watch set var self.speed
Watchpoint created: Watchpoint 1: addr = 0x6080000a4698 size = 8
state = enabled type = w

declare @ ‘/Projects/SwiftCars/ViewController.swift:28’

watchpoint spec = 'self.speed'
watch modify -c …
-i …
(lldb) watch set var _speed
Watchpoint created: Watchpoint 1: addr = 0x7fb9c145d768 size

= 8 state = enabled type = w

watchpoint spec = ‘_speed'

new value: 0
(lldb) watch modify -c '(_speed==15)'
(lldb) c

Process 2150 resuming

Watchpoint 1 hit:

old value: 0

new value: 15

(lldb)
(lldb) watch set var self.speed
Watchpoint created: Watchpoint 1: addr = 0x6080000a4698 size = 8
state = enabled type = w

declare @ ‘/Projects/SwiftCars/ViewController.swift:28’

watchpoint spec = 'self.speed'
(lldb) watch modify -c ‘(self.speed==15)’ 1
(lldb) c



Watchpoint 1 hit:
(lldb) po self.speed

6
❌
(lldb) watch command add 1
Enter your debugger command(s). Type 'DONE' to end.

> p _speed

> continue

> DONE
(lldb) c

Process 2252 resuming
(NSInteger) $16 = 15

Process 2252 resuming

Command #2 'continue' continued the target.
watch delete
watch enable
watch disable
(lldb) watch disable 1

1 watchpoints disabled.
(lldb) watch enable 1

1 watchpoints enabled.
Script
write code to debug
your code
copy + paste
script
(lldb) help script
Pass an expression to the script interpreter for evaluation and
return the results. Drop into the interactive interpreter if no
expression is given. This command takes 'raw' input (no need to
quote stuff).
Syntax: script [<script-expression-for-evaluation>]
(lldb) script

Python Interactive Interpreter. To exit, type 'quit()', 'exit()'.
>>> print lldb.debugger
Debugger (instance: "debugger_47", id: 47)
>>> print lldb.target
Cars
>>> print lldb.process
SBProcess: pid = 6425, state = stopped, threads = 5, executable =
Cars
>>> print lldb.thread
SBThread: tid = 0x3813e
>>> print lldb.frame
frame #0: 0x0000000103075979 Cars`-[ViewController viewDidLoad]
(self=0x00007f8173f23680, _cmd=0x0000000104507cfb) + 57 at
ViewController.m:24
>>> quit()
Writing functions
def breakpoint_func(frame, bp_loc, dict):
# implementation here
# return false to skip
current stack frame breakpoint locationpython session dictuseless
Sample Case
only stop when
-changeGearTo:
is in the call stack
find_in_stack = ['-[Car changeGearTo:]']
def continue_ignored(frame, bp_loc, dict):
global find_in_stack
names = set([frame.GetFunctionName() for frame 

in frame.GetThread()])
all_ignored = set(find_in_stack)
ignored_here = all_ignored.intersection(names)
if len(ignored_here) == 0:
return False
quit()
find_in_stack = ['-[Car changeGearTo:]']
def continue_ignored(frame, bp_loc, dict):
global find_in_stack
names = set([frame.GetFunctionName() for frame 

in frame.GetThread()])
all_ignored = set(find_in_stack)
ignored_here = all_ignored.intersection(names)
if len(ignored_here) == 0:
return False
quit()
find_in_stack = ['-[Car changeGearTo:]']
def continue_ignored(frame, bp_loc, dict):
global find_in_stack
names = set([frame.GetFunctionName() for frame 

in frame.GetThread()])
all_ignored = set(find_in_stack)
ignored_here = all_ignored.intersection(names)
if len(ignored_here) == 0:
return False
quit()
find_in_stack = ['-[Car changeGearTo:]']
def continue_ignored(frame, bp_loc, dict):
global find_in_stack
names = set([frame.GetFunctionName() for frame 

in frame.GetThread()])
all_ignored = set(find_in_stack)

ignored_here = all_ignored.intersection(names)
if len(ignored_here) == 0:

return False

quit()
stack symbol
function declaration
global accessor
all functions in stack
check if symbol we want
is in this stack
if it isn’t, continue
find_in_stack = ['-[Car changeGearTo:]']
def continue_ignored(frame, bp_loc, dict):
global find_in_stack
names = set([frame.GetFunctionName() for frame 

in frame.GetThread()])
all_ignored = set(find_in_stack)
ignored_here = all_ignored.intersection(names)
if len(ignored_here) == 0:
return False
quit()
find_in_stack = ['SwiftCars.Car.changeGearTo']
Module
br command add -s
python #
(lldb) br command add -s python 2
Enter your Python command(s). Type 'DONE' to end.

def function(frame,bp_loc,internal_dict):

"""frame: the SBFrame for the location at which you stopped

bp_loc: an SBBreakpointLocation for the breakpoint
location information

internal_dict: an LLDB support object not to be used"""
global find_in_stack

find_in_stack = ['-[Car changeGearTo:]']

names = set([frame.GetFunctionName() for frame in
frame.GetThread()])

all_ignored = set(find_in_stack)

ignored_here = all_ignored.intersection(names)

if len(ignored_here) == 0:

return False

DONE
(lldb) br command add -s python 2 -o “print 1+1”
type summary
Use A Python
Function To Better
Describe A Class
Swift
def Car_Summary(value,unused):
make = value.GetChildMemberWithName("_make")
model = value.GetChildMemberWithName("_model")
makeSummary = make.GetSummary()
modelSummary = model.GetSummary()
return makeSummary + " " + modelSummary
quit()
def Car_Summary(value,unused):
make = value.GetChildMemberWithName("_make")
model = value.GetChildMemberWithName("_model")
makeSummary = make.GetSummary()
modelSummary = model.GetSummary()
return makeSummary + " " + modelSummary
quit()
def Car_Summary(value,unused):
make = value.GetChildMemberWithName("_make")

model = value.GetChildMemberWithName("_model")
makeSummary = make.GetSummary()

modelSummary = model.GetSummary()
return makeSummary + " " + modelSummary


quit()
value is the frame
get the variables we want
printable
summaries
return a string
def Car_Summary(value,unused):
make = value.GetChildMemberWithName("_make")
model = value.GetChildMemberWithName("_model")
makeSummary = make.GetSummary()
modelSummary = model.GetSummary()
return makeSummary + " " + modelSummary
quit()
More Use Cases
• Only break after another breakpoint has
been hit
• Check multiple threads for a symbol
• Data formatters for everything in Objc
• Custom LLDB commands
Questions?
@MicheleTitolo
• WWDC ’13 Session 413
• WWDC ’14 Sessions 409 & 410
• http://lldb.llvm.org/
• http://www.objc.io/issue-19/lldb-debugging.html
• http://blog.ittybittyapps.com/blog/2013/11/07/
integrating-reveal-without-modifying-your-xcode-
project/
• https://github.com/facebook/chisel
• https://developer.apple.com/library/mac/
documentation/IDEs/Conceptual/
gdb_to_lldb_transition_guide/document/lldb-terminal-
workflow-tutorial.html
Resources
• https://unsplash.com/photos/
eMnddgd3pjQ
• https://unsplash.com/photos/
KpBAYMNf9Tw
Photo Credits

More Related Content

What's hot

Erlang Introduction Bcberlin3
Erlang Introduction Bcberlin3Erlang Introduction Bcberlin3
Erlang Introduction Bcberlin3
guesta3202
 
Alexey Tsoy Meta Programming in C++ 16.11.17
Alexey Tsoy Meta Programming in C++ 16.11.17Alexey Tsoy Meta Programming in C++ 16.11.17
Alexey Tsoy Meta Programming in C++ 16.11.17
LogeekNightUkraine
 
Oops practical file
Oops practical fileOops practical file
Oops practical file
Ankit Dixit
 
informatics practices practical file
informatics practices practical fileinformatics practices practical file
informatics practices practical file
Sai Sathvick Chirakala
 
Container adapters
Container adaptersContainer adapters
Container adapters
mohamed sikander
 
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...
Kevlin Henney
 
What We Talk About When We Talk About Unit Testing
What We Talk About When We Talk About Unit TestingWhat We Talk About When We Talk About Unit Testing
What We Talk About When We Talk About Unit Testing
Kevlin Henney
 
Functional C++
Functional C++Functional C++
Functional C++
Kevlin Henney
 
Programming with GUTs
Programming with GUTsProgramming with GUTs
Programming with GUTs
Kevlin Henney
 
C++ practical
C++ practicalC++ practical
C++ practical
Rahul juneja
 
Using Redux-Saga for Handling Side Effects
Using Redux-Saga for Handling Side EffectsUsing Redux-Saga for Handling Side Effects
Using Redux-Saga for Handling Side Effects
GlobalLogic Ukraine
 
Pointers
PointersPointers
Pointers
Hitesh Wagle
 
P1
P1P1
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
Pranav Ghildiyal
 
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий КуриловАсинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Yandex
 
Operator overloading2
Operator overloading2Operator overloading2
Operator overloading2
zindadili
 
Quest 1 define a class batsman with the following specifications
Quest  1 define a class batsman with the following specificationsQuest  1 define a class batsman with the following specifications
Quest 1 define a class batsman with the following specifications
rajkumari873
 
Impact of the New ORM on Your Modules
Impact of the New ORM on Your ModulesImpact of the New ORM on Your Modules
Impact of the New ORM on Your Modules
Odoo
 
Async code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Async code on kotlin: rx java or/and coroutines - Kotlin Night TurinAsync code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Async code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Fabio Collini
 
Build Lightweight Web Module
Build Lightweight Web ModuleBuild Lightweight Web Module
Build Lightweight Web Module
Morgan Cheng
 

What's hot (20)

Erlang Introduction Bcberlin3
Erlang Introduction Bcberlin3Erlang Introduction Bcberlin3
Erlang Introduction Bcberlin3
 
Alexey Tsoy Meta Programming in C++ 16.11.17
Alexey Tsoy Meta Programming in C++ 16.11.17Alexey Tsoy Meta Programming in C++ 16.11.17
Alexey Tsoy Meta Programming in C++ 16.11.17
 
Oops practical file
Oops practical fileOops practical file
Oops practical file
 
informatics practices practical file
informatics practices practical fileinformatics practices practical file
informatics practices practical file
 
Container adapters
Container adaptersContainer adapters
Container adapters
 
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...
 
What We Talk About When We Talk About Unit Testing
What We Talk About When We Talk About Unit TestingWhat We Talk About When We Talk About Unit Testing
What We Talk About When We Talk About Unit Testing
 
Functional C++
Functional C++Functional C++
Functional C++
 
Programming with GUTs
Programming with GUTsProgramming with GUTs
Programming with GUTs
 
C++ practical
C++ practicalC++ practical
C++ practical
 
Using Redux-Saga for Handling Side Effects
Using Redux-Saga for Handling Side EffectsUsing Redux-Saga for Handling Side Effects
Using Redux-Saga for Handling Side Effects
 
Pointers
PointersPointers
Pointers
 
P1
P1P1
P1
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
 
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий КуриловАсинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
 
Operator overloading2
Operator overloading2Operator overloading2
Operator overloading2
 
Quest 1 define a class batsman with the following specifications
Quest  1 define a class batsman with the following specificationsQuest  1 define a class batsman with the following specifications
Quest 1 define a class batsman with the following specifications
 
Impact of the New ORM on Your Modules
Impact of the New ORM on Your ModulesImpact of the New ORM on Your Modules
Impact of the New ORM on Your Modules
 
Async code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Async code on kotlin: rx java or/and coroutines - Kotlin Night TurinAsync code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Async code on kotlin: rx java or/and coroutines - Kotlin Night Turin
 
Build Lightweight Web Module
Build Lightweight Web ModuleBuild Lightweight Web Module
Build Lightweight Web Module
 

Similar to More than po: Debugging in LLDB

Part II: LLVM Intermediate Representation
Part II: LLVM Intermediate RepresentationPart II: LLVM Intermediate Representation
Part II: LLVM Intermediate Representation
Wei-Ren Chen
 
HKG15-207: Advanced Toolchain Usage Part 3
HKG15-207: Advanced Toolchain Usage Part 3HKG15-207: Advanced Toolchain Usage Part 3
HKG15-207: Advanced Toolchain Usage Part 3
Linaro
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기
Ji Hun Kim
 
HKG15-211: Advanced Toolchain Usage Part 4
HKG15-211: Advanced Toolchain Usage Part 4HKG15-211: Advanced Toolchain Usage Part 4
HKG15-211: Advanced Toolchain Usage Part 4
Linaro
 
Hot Code is Faster Code - Addressing JVM Warm-up
Hot Code is Faster Code - Addressing JVM Warm-upHot Code is Faster Code - Addressing JVM Warm-up
Hot Code is Faster Code - Addressing JVM Warm-up
Mark Price
 
Boosting Developer Productivity with Clang
Boosting Developer Productivity with ClangBoosting Developer Productivity with Clang
Boosting Developer Productivity with Clang
Samsung Open Source Group
 
Sangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesSangam 2019 - The Latest Features
Sangam 2019 - The Latest Features
Connor McDonald
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
Wim Godden
 
Java bytecode Malware Analysis
Java bytecode Malware AnalysisJava bytecode Malware Analysis
Java bytecode Malware Analysis
Brian Baskin
 
The Ring programming language version 1.5.1 book - Part 26 of 180
The Ring programming language version 1.5.1 book - Part 26 of 180The Ring programming language version 1.5.1 book - Part 26 of 180
The Ring programming language version 1.5.1 book - Part 26 of 180
Mahmoud Samir Fayed
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
Wim Godden
 
Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019
Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019
Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019
corehard_by
 
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeksBeginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
JinTaek Seo
 
Runtime Symbol Resolution
Runtime Symbol ResolutionRuntime Symbol Resolution
Runtime Symbol Resolution
Ken Kawamoto
 
The Ring programming language version 1.10 book - Part 36 of 212
The Ring programming language version 1.10 book - Part 36 of 212The Ring programming language version 1.10 book - Part 36 of 212
The Ring programming language version 1.10 book - Part 36 of 212
Mahmoud Samir Fayed
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developers
Connor McDonald
 
basic computer programming and micro programmed control
basic computer programming and micro programmed controlbasic computer programming and micro programmed control
basic computer programming and micro programmed control
Rai University
 
Chapter7.pptx
Chapter7.pptxChapter7.pptx
Chapter7.pptx
radhushri
 
MySQL Tokudb engine benchmark
MySQL Tokudb engine benchmarkMySQL Tokudb engine benchmark
MySQL Tokudb engine benchmark
Louis liu
 
Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨
flyinweb
 

Similar to More than po: Debugging in LLDB (20)

Part II: LLVM Intermediate Representation
Part II: LLVM Intermediate RepresentationPart II: LLVM Intermediate Representation
Part II: LLVM Intermediate Representation
 
HKG15-207: Advanced Toolchain Usage Part 3
HKG15-207: Advanced Toolchain Usage Part 3HKG15-207: Advanced Toolchain Usage Part 3
HKG15-207: Advanced Toolchain Usage Part 3
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기
 
HKG15-211: Advanced Toolchain Usage Part 4
HKG15-211: Advanced Toolchain Usage Part 4HKG15-211: Advanced Toolchain Usage Part 4
HKG15-211: Advanced Toolchain Usage Part 4
 
Hot Code is Faster Code - Addressing JVM Warm-up
Hot Code is Faster Code - Addressing JVM Warm-upHot Code is Faster Code - Addressing JVM Warm-up
Hot Code is Faster Code - Addressing JVM Warm-up
 
Boosting Developer Productivity with Clang
Boosting Developer Productivity with ClangBoosting Developer Productivity with Clang
Boosting Developer Productivity with Clang
 
Sangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesSangam 2019 - The Latest Features
Sangam 2019 - The Latest Features
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Java bytecode Malware Analysis
Java bytecode Malware AnalysisJava bytecode Malware Analysis
Java bytecode Malware Analysis
 
The Ring programming language version 1.5.1 book - Part 26 of 180
The Ring programming language version 1.5.1 book - Part 26 of 180The Ring programming language version 1.5.1 book - Part 26 of 180
The Ring programming language version 1.5.1 book - Part 26 of 180
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019
Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019
Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019
 
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeksBeginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
 
Runtime Symbol Resolution
Runtime Symbol ResolutionRuntime Symbol Resolution
Runtime Symbol Resolution
 
The Ring programming language version 1.10 book - Part 36 of 212
The Ring programming language version 1.10 book - Part 36 of 212The Ring programming language version 1.10 book - Part 36 of 212
The Ring programming language version 1.10 book - Part 36 of 212
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developers
 
basic computer programming and micro programmed control
basic computer programming and micro programmed controlbasic computer programming and micro programmed control
basic computer programming and micro programmed control
 
Chapter7.pptx
Chapter7.pptxChapter7.pptx
Chapter7.pptx
 
MySQL Tokudb engine benchmark
MySQL Tokudb engine benchmarkMySQL Tokudb engine benchmark
MySQL Tokudb engine benchmark
 
Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨
 

More from Michele Titolo

Writing Design Docs for Wide Audiences
Writing Design Docs for Wide AudiencesWriting Design Docs for Wide Audiences
Writing Design Docs for Wide Audiences
Michele Titolo
 
Beam Me Up: Voyaging into Big Data
Beam Me Up: Voyaging into Big DataBeam Me Up: Voyaging into Big Data
Beam Me Up: Voyaging into Big Data
Michele Titolo
 
APIs: The Good, The Bad, The Ugly
APIs: The Good, The Bad, The UglyAPIs: The Good, The Bad, The Ugly
APIs: The Good, The Bad, The Ugly
Michele Titolo
 
Tackling the Big, Impossible Project
Tackling the Big, Impossible ProjectTackling the Big, Impossible Project
Tackling the Big, Impossible Project
Michele Titolo
 
No Microservice is an Island
No Microservice is an IslandNo Microservice is an Island
No Microservice is an Island
Michele Titolo
 
From iOS to Distributed Systems
From iOS to Distributed SystemsFrom iOS to Distributed Systems
From iOS to Distributed Systems
Michele Titolo
 
APIs for the Mobile World
APIs for the Mobile WorldAPIs for the Mobile World
APIs for the Mobile World
Michele Titolo
 
Swift Generics in Theory and Practice
Swift Generics in Theory and PracticeSwift Generics in Theory and Practice
Swift Generics in Theory and Practice
Michele Titolo
 
Protocols promised-land-2
Protocols promised-land-2Protocols promised-land-2
Protocols promised-land-2
Michele Titolo
 
Multitasking
MultitaskingMultitasking
Multitasking
Michele Titolo
 
Making friendly-microservices
Making friendly-microservicesMaking friendly-microservices
Making friendly-microservices
Michele Titolo
 
The Worst Code
The Worst CodeThe Worst Code
The Worst Code
Michele Titolo
 
Can't Handle My Scale v2
Can't Handle My Scale v2Can't Handle My Scale v2
Can't Handle My Scale v2
Michele Titolo
 
Can't Handle My Scale
Can't Handle My ScaleCan't Handle My Scale
Can't Handle My Scale
Michele Titolo
 
Cocoa Design Patterns in Swift
Cocoa Design Patterns in SwiftCocoa Design Patterns in Swift
Cocoa Design Patterns in Swift
Michele Titolo
 
Mastering the Project File (AltConf)
Mastering the Project File (AltConf)Mastering the Project File (AltConf)
Mastering the Project File (AltConf)
Michele Titolo
 
APIs: The Ugly
APIs: The UglyAPIs: The Ugly
APIs: The Ugly
Michele Titolo
 
That's Not My Code!
That's Not My Code!That's Not My Code!
That's Not My Code!
Michele Titolo
 
APIs: The good, the bad, the ugly
APIs: The good, the bad, the uglyAPIs: The good, the bad, the ugly
APIs: The good, the bad, the ugly
Michele Titolo
 
Mobile APIs
Mobile APIsMobile APIs
Mobile APIs
Michele Titolo
 

More from Michele Titolo (20)

Writing Design Docs for Wide Audiences
Writing Design Docs for Wide AudiencesWriting Design Docs for Wide Audiences
Writing Design Docs for Wide Audiences
 
Beam Me Up: Voyaging into Big Data
Beam Me Up: Voyaging into Big DataBeam Me Up: Voyaging into Big Data
Beam Me Up: Voyaging into Big Data
 
APIs: The Good, The Bad, The Ugly
APIs: The Good, The Bad, The UglyAPIs: The Good, The Bad, The Ugly
APIs: The Good, The Bad, The Ugly
 
Tackling the Big, Impossible Project
Tackling the Big, Impossible ProjectTackling the Big, Impossible Project
Tackling the Big, Impossible Project
 
No Microservice is an Island
No Microservice is an IslandNo Microservice is an Island
No Microservice is an Island
 
From iOS to Distributed Systems
From iOS to Distributed SystemsFrom iOS to Distributed Systems
From iOS to Distributed Systems
 
APIs for the Mobile World
APIs for the Mobile WorldAPIs for the Mobile World
APIs for the Mobile World
 
Swift Generics in Theory and Practice
Swift Generics in Theory and PracticeSwift Generics in Theory and Practice
Swift Generics in Theory and Practice
 
Protocols promised-land-2
Protocols promised-land-2Protocols promised-land-2
Protocols promised-land-2
 
Multitasking
MultitaskingMultitasking
Multitasking
 
Making friendly-microservices
Making friendly-microservicesMaking friendly-microservices
Making friendly-microservices
 
The Worst Code
The Worst CodeThe Worst Code
The Worst Code
 
Can't Handle My Scale v2
Can't Handle My Scale v2Can't Handle My Scale v2
Can't Handle My Scale v2
 
Can't Handle My Scale
Can't Handle My ScaleCan't Handle My Scale
Can't Handle My Scale
 
Cocoa Design Patterns in Swift
Cocoa Design Patterns in SwiftCocoa Design Patterns in Swift
Cocoa Design Patterns in Swift
 
Mastering the Project File (AltConf)
Mastering the Project File (AltConf)Mastering the Project File (AltConf)
Mastering the Project File (AltConf)
 
APIs: The Ugly
APIs: The UglyAPIs: The Ugly
APIs: The Ugly
 
That's Not My Code!
That's Not My Code!That's Not My Code!
That's Not My Code!
 
APIs: The good, the bad, the ugly
APIs: The good, the bad, the uglyAPIs: The good, the bad, the ugly
APIs: The good, the bad, the ugly
 
Mobile APIs
Mobile APIsMobile APIs
Mobile APIs
 

Recently uploaded

Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
Drona Infotech
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 

Recently uploaded (20)

Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 

More than po: Debugging in LLDB

  • 1. More Than Po: Debugging In lldb @MicheleTitolo Lead Software Engineer @ Capital One
  • 3. What We’ll Cover • LLDB basics • Advanced thread, breakpoint, watchpoint debugging • Debugging with script
  • 5. frame lang == lldb lang
  • 8. po
  • 10. (lldb) po self.myCar <Car: 0x7fc8206334d0>
  • 13. (lldb) po self.myCar 2014 Tesla S UIDeviceRGBColorSpace 0 0 1 1
  • 14. p
  • 17. (lldb) p *self.myCar (Car) $1 = {
 NSObject = {
 isa = Car
 }
 _running = NO
 _make = 0x000000010077d088 @"Tesla"
 _model = 0x000000010077d0a8 @"S"
 _year = 2014
 _color = 0x00007fd531eb9e30
 _gear = Park
 }
  • 18. (lldb) po self.myCar <SwiftCars.Car: 0x7fe8bb456a60>
 (lldb) p *self.myCar error: <EXPR>:1:1: error: '*' is not a prefix unary operator
 *self.myCar
 ^
  • 19. use expr to modify values at runtime
  • 20. (lldb) po self.myCar
 2014 Tesla S UIDeviceRGBColorSpace 0 0 1 1
 (lldb) expr self.myCar.year = 2013 (NSInteger) $0 = 2013
 (lldb) po self.myCar
 2013 Tesla S UIDeviceRGBColorSpace 0 0 1 1
  • 22. fr v
  • 23. (lldb) fr v (ViewController *) self = 0x00007f9628520cd0
 (SEL) _cmd = "updateTipLabelsForBillAmount:"
 (float) billAmount = 33
 (float) tipPercentage = 0.200000003
 (float) tipAmount = 6.5999999
 (float) total = 39.5999985
  • 24. (lldb) fr v -F self.myCar self.myCar = 0x00007fe8bb456a60
 self.myCar =
 self.myCar.isa = SwiftCars.Car
 self.myCar.make._core._owner = nil
 self.myCar.model._core._owner = nil
 self.myCar.color = 0x00007fe8bb452c80
 self.myCar.color.isa = UICachedDeviceRGBColor
 self.myCar.color._systemColorName = 0x00007fe8bb4424c0 “blueColor"
 self.myCar.color.redComponent = 0
 self.myCar.color.greenComponent = 0
 self.myCar.color.blueComponent = 1
 self.myCar.color.alphaComponent = 1
 self.myCar.color.cachedColor = 0x0000000000000000
 self.myCar.color.cachedColorOnceToken = 0

  • 25. bt
  • 27. (lldb) bt * thread #1: tid = 0x66c2, 0x0000000101a90330 Cars`- [ViewController viewDidLoad](self=0x00007fc3d2c21570, _cmd=0x0000000102f21cfb) + 448 at ViewController.m:28, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
 * frame #0: 0x0000000101a90330 Cars`-[ViewController viewDidLoad](self=0x00007fc3d2c21570, _cmd=0x0000000102f21cfb) + 448 at ViewController.m:28
 frame #1: 0x000000010284f090 UIKit`-[UIViewController loadViewIfRequired] + 738
 frame #2: 0x000000010284f28e UIKit`-[UIViewController view] + 27
 frame #3: 0x000000010276b5e9 UIKit`-[UIWindow addRootViewControllerViewIfPossible] + 58
 frame #4: 0x000000010276b9af UIKit`-[UIWindow _setHidden:forced:] + 247

  • 29.
  • 30.
  • 32.
  • 33.
  • 35.
  • 36.
  • 38.
  • 40. settings set prompt [lldb]$ command alias bd breakpoint disable command alias be breakpoint enable command alias bdel breakpoint delete command alias bcommand breakpoint command add command alias commands breakpoint command list
  • 42. (lldb) process attach -p 5416 Process 5416 stopped
 * thread #1: tid = 0xe4b02, 0x0000000106e234de
 libsystem_kernel.dylib`mach_msg_trap + 10, queue = 'com.apple.main
 thread', stop reason = signal SIGSTOP
 frame #0: 0x0000000106e234de libsystem_kernel.dylib`mach_msg_trap +
 10
 libsystem_kernel.dylib`mach_msg_trap:
 -> 0x106e234de <+10>: retq
 0x106e234df <+11>: nop
 
 libsystem_kernel.dylib`mach_msg_overwrite_trap:
 0x106e234e0 <+0>: movq %rcx, %r10
 0x106e234e3 <+3>: movl $0x1000020, %eax
 
 Executable module set to "/Users/michele/Library/Developer/CoreSimulator/Devices/ 5304657F-1710-42A1-87CA-E5358E87F4C8/data/Containers/Bundle/Application/312BA401-3B1E-4A17- B7E8-BAAAE13EC463/Cars.app/Cars".
 Architecture set to: x86_64h-apple-ios. (lldb) c Process 5416 resuming
  • 43.
  • 44. help
  • 51. (lldb) thread info thread #1: tid = 0x66c2, 0x0000000101a90330 Cars`-[ViewController viewDidLoad](self=0x00007fc3d2c21570, _cmd=0x0000000102f21cfb) + 448 at ViewController.m:28, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  • 53. (lldb) thread list Process 921 stopped
 * thread #1: tid = 0x66c2, 0x0000000101a90330 Cars`- [ViewController viewDidLoad](self=0x00007fc3d2c21570, _cmd=0x0000000102f21cfb) + 448 at ViewController.m:28, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
 thread #2: tid = 0x66da, 0x0000000104bcc232 libsystem_kernel.dylib`kevent64 + 10, queue = 'com.apple.libdispatch-manager'
 thread #3: tid = 0x66dc, 0x0000000104bc651a libsystem_kernel.dylib`semaphore_wait_trap + 10, queue = 'FBSSerialQueue'
 thread #4: tid = 0x66dd, 0x0000000104bcb94a libsystem_kernel.dylib`__workq_kernreturn + 10
 thread #5: tid = 0x66de, 0x0000000104bcb94a libsystem_kernel.dylib`__workq_kernreturn + 10

  • 55. (lldb) thread until 31 Process 1615 resuming
 (lldb)
  • 57. (lldb) thread return NO (lldb) thread return [NSNumber numberWithInt:7] (lldb) thread return @"Hello"
  • 58. (lldb) thread return true error: Error returning from frame 0 of thread 1: We only support setting simple integer and float return types at present..
  • 60.
  • 63. (lldb) br list Current breakpoints:
 1: file = 'Cars/Car.m', line = 50, locations = 1, resolved = 1, hit count = 0
 
 1.1: where = Cars`-[Car changeGearTo:] + 52 at Car.m:50, address = 0x00000001026fd4e4, resolved, hit count = 0 
 
 2: file = 'Cars/ViewController.m', line = 31, locations = 1, resolved = 1, hit count = 1
 
 2.1: where = Cars`-[ViewController viewDidLoad] + 512 at ViewController.m:31, address = 0x00000001026fcb40, resolved, hit count = 1
  • 65. (lldb) br set -f ViewController.m -l 31 Breakpoint 2: where = Cars`-[ViewController viewDidLoad] +
 512 at ViewController.m:31, address = 0x000000010e2bdb40
  • 66. (lldb) br set -F "-[Car changeGearTo:]” Breakpoint 3: where = Cars`-[Car changeGearTo:] + 20 at
 Car.m:47, address = 0x00000001073ba4c4
  • 67. (lldb) br set -F “SwiftCars.Car.changeGearTo(gear: Cars.Gear) -> ()” Breakpoint 10: where = SwiftCars`SwiftCars.Car.changeGearTo(gear: SwiftCars.Gear) -> () + 18 at ViewController.swift:35, address = 0x000000010c97e032
  • 68. SwiftCars.Car.changeGearTo(gear: SwiftCars.Gear) -> () Module Name Type Function signature Namespaced
  • 69. SwiftCars.Car.increaseSpeedTo(speed: Swift.Int) -> () Built-in types are in the Swift module
  • 72. (lldb) br ViewController.m:31 error: command 'breakpoint' did not recognize 'ViewController .m: 31' as valid (subcommand might be invalid).
  • 73. (lldb) b Car.m:63
 Breakpoint 2: where = Cars`-[Car increaseSpeedTo:] + 118 at Car.m:63, address = 0x0000000100b7a576
 (lldb) br modify -c "speed==15" 2 (lldb) c
 Process 3093 resuming
 (lldb)
  • 74.
  • 75. (lldb) br modify -c "speed==15 && self.gear==4” 2
  • 76. (lldb) br modify -c "speed==15 && gear==Gear.Drive" 1
  • 77. (lldb) br modify -c "speed==20 && [self canChangeGearTo:4]" 2
  • 78. (lldb) br modify -c "speed==15 && self.gear==4" -i 17 2
  • 79. -i <count> ( --ignore-count <count> ) Set the number of times this breakpoint is skipped before stopping.
  • 80. -i <count> ( --ignore-count <count> ) Set the minimum number of times this breakpoint is skipped before stopping.
  • 81. (lldb) br delete 2 1 breakpoints deleted; 0 breakpoint locations disabled.
  • 83. (lldb) breakpoint disable 2 1 breakpoints disabled. 
 ...
 2: file = 'Cars/ViewController.m', line = 31, locations = 1 Options: disabled
  • 84. (lldb) breakpoint enable 2 1 breakpoints enabled.
 ...
 2: file = 'Cars/ViewController.m', line = 31, locations = 1, resolved = 1, hit count = 1
  • 86. (lldb) br command add -o "fr v" 2 (lldb) fr v
 (Car *) self = 0x00007fb59ad142b0
 (SEL) _cmd = "changeGearTo:"
 (Gear) gear = Neutral
  • 87. (lldb) br command add 1 Enter your debugger command(s). Type 'DONE' to end.
 > fr v
 > continue
 > DONE (lldb) fr v
 (Car *) self = 0x00007f8061625490
 (SEL) _cmd = "changeGearTo:"
 (Gear) gear = Reverse
 (lldb) continue
 Process 2068 resuming
 Command #2 'continue' continued the target.
  • 88. (lldb) br command list 3 Breakpoint 3:
 Breakpoint commands:
 fr v
  • 89. (lldb) br command delete 3
  • 90. Breakpoints Added In Console Do Not Persist Between Runs
  • 92.
  • 93. A Watchpoint Tracks A Value Over Time
  • 95. [self.myCar addObserver:self
 forKeyPath:@"speed"
 options:NSKeyValueObservingOptionNew
 context:KVOContext];
 
 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
 {
 if (car.speed > 1000) {
 NSLog(@"WHY AM I GOING SO FAST %ld",
 (long)car.speed);
 }
 }
  • 96. - (void)setSpeed:(NSInteger)speed { _speed = speed; if (_speed > 1000) { NSLog(@"WHY AM I GOING SO FAST %ld", (long)_speed); } }
  • 100. (lldb) watch set var self.speed
 error: "self" is a pointer and . was used to attempt to
 access "speed". Did you mean "self->speed"? (lldb) watch set var self->speed
 error: "speed" is not a member of "(Car *const) self" (lldb) watch set var _speed
  • 101. (lldb) watch set var self.speed Watchpoint created: Watchpoint 1: addr = 0x6080000a4698 size = 8 state = enabled type = w
 declare @ ‘/Projects/SwiftCars/ViewController.swift:28’
 watchpoint spec = 'self.speed'
  • 102. watch modify -c … -i …
  • 103. (lldb) watch set var _speed Watchpoint created: Watchpoint 1: addr = 0x7fb9c145d768 size
 = 8 state = enabled type = w
 watchpoint spec = ‘_speed'
 new value: 0 (lldb) watch modify -c '(_speed==15)' (lldb) c
 Process 2150 resuming
 Watchpoint 1 hit:
 old value: 0
 new value: 15
 (lldb)
  • 104. (lldb) watch set var self.speed Watchpoint created: Watchpoint 1: addr = 0x6080000a4698 size = 8 state = enabled type = w
 declare @ ‘/Projects/SwiftCars/ViewController.swift:28’
 watchpoint spec = 'self.speed' (lldb) watch modify -c ‘(self.speed==15)’ 1 (lldb) c
 
 Watchpoint 1 hit: (lldb) po self.speed
 6 ❌
  • 105. (lldb) watch command add 1 Enter your debugger command(s). Type 'DONE' to end.
 > p _speed
 > continue
 > DONE (lldb) c
 Process 2252 resuming (NSInteger) $16 = 15
 Process 2252 resuming
 Command #2 'continue' continued the target.
  • 107. (lldb) watch disable 1
 1 watchpoints disabled. (lldb) watch enable 1
 1 watchpoints enabled.
  • 108. Script
  • 109.
  • 110. write code to debug your code
  • 112.
  • 113. script
  • 114. (lldb) help script Pass an expression to the script interpreter for evaluation and return the results. Drop into the interactive interpreter if no expression is given. This command takes 'raw' input (no need to quote stuff). Syntax: script [<script-expression-for-evaluation>]
  • 115. (lldb) script
 Python Interactive Interpreter. To exit, type 'quit()', 'exit()'. >>> print lldb.debugger Debugger (instance: "debugger_47", id: 47) >>> print lldb.target Cars >>> print lldb.process SBProcess: pid = 6425, state = stopped, threads = 5, executable = Cars >>> print lldb.thread SBThread: tid = 0x3813e >>> print lldb.frame frame #0: 0x0000000103075979 Cars`-[ViewController viewDidLoad] (self=0x00007f8173f23680, _cmd=0x0000000104507cfb) + 57 at ViewController.m:24 >>> quit()
  • 117. def breakpoint_func(frame, bp_loc, dict): # implementation here # return false to skip current stack frame breakpoint locationpython session dictuseless
  • 119. only stop when -changeGearTo: is in the call stack
  • 120. find_in_stack = ['-[Car changeGearTo:]'] def continue_ignored(frame, bp_loc, dict): global find_in_stack names = set([frame.GetFunctionName() for frame 
 in frame.GetThread()]) all_ignored = set(find_in_stack) ignored_here = all_ignored.intersection(names) if len(ignored_here) == 0: return False quit() find_in_stack = ['-[Car changeGearTo:]'] def continue_ignored(frame, bp_loc, dict): global find_in_stack names = set([frame.GetFunctionName() for frame 
 in frame.GetThread()]) all_ignored = set(find_in_stack) ignored_here = all_ignored.intersection(names) if len(ignored_here) == 0: return False quit()
  • 121. find_in_stack = ['-[Car changeGearTo:]'] def continue_ignored(frame, bp_loc, dict): global find_in_stack names = set([frame.GetFunctionName() for frame 
 in frame.GetThread()]) all_ignored = set(find_in_stack) ignored_here = all_ignored.intersection(names) if len(ignored_here) == 0: return False quit() find_in_stack = ['-[Car changeGearTo:]'] def continue_ignored(frame, bp_loc, dict): global find_in_stack names = set([frame.GetFunctionName() for frame 
 in frame.GetThread()]) all_ignored = set(find_in_stack)
 ignored_here = all_ignored.intersection(names) if len(ignored_here) == 0:
 return False
 quit() stack symbol function declaration global accessor all functions in stack check if symbol we want is in this stack if it isn’t, continue
  • 122. find_in_stack = ['-[Car changeGearTo:]'] def continue_ignored(frame, bp_loc, dict): global find_in_stack names = set([frame.GetFunctionName() for frame 
 in frame.GetThread()]) all_ignored = set(find_in_stack) ignored_here = all_ignored.intersection(names) if len(ignored_here) == 0: return False quit()
  • 124. br command add -s python #
  • 125. (lldb) br command add -s python 2 Enter your Python command(s). Type 'DONE' to end.
 def function(frame,bp_loc,internal_dict):
 """frame: the SBFrame for the location at which you stopped
 bp_loc: an SBBreakpointLocation for the breakpoint location information
 internal_dict: an LLDB support object not to be used""" global find_in_stack
 find_in_stack = ['-[Car changeGearTo:]']
 names = set([frame.GetFunctionName() for frame in frame.GetThread()])
 all_ignored = set(find_in_stack)
 ignored_here = all_ignored.intersection(names)
 if len(ignored_here) == 0:
 return False
 DONE
  • 126.
  • 127. (lldb) br command add -s python 2 -o “print 1+1”
  • 129. Use A Python Function To Better Describe A Class
  • 130. Swift
  • 131. def Car_Summary(value,unused): make = value.GetChildMemberWithName("_make") model = value.GetChildMemberWithName("_model") makeSummary = make.GetSummary() modelSummary = model.GetSummary() return makeSummary + " " + modelSummary quit()
  • 132. def Car_Summary(value,unused): make = value.GetChildMemberWithName("_make") model = value.GetChildMemberWithName("_model") makeSummary = make.GetSummary() modelSummary = model.GetSummary() return makeSummary + " " + modelSummary quit() def Car_Summary(value,unused): make = value.GetChildMemberWithName("_make")
 model = value.GetChildMemberWithName("_model") makeSummary = make.GetSummary()
 modelSummary = model.GetSummary() return makeSummary + " " + modelSummary 
 quit() value is the frame get the variables we want printable summaries return a string
  • 133. def Car_Summary(value,unused): make = value.GetChildMemberWithName("_make") model = value.GetChildMemberWithName("_model") makeSummary = make.GetSummary() modelSummary = model.GetSummary() return makeSummary + " " + modelSummary quit()
  • 134.
  • 135. More Use Cases • Only break after another breakpoint has been hit • Check multiple threads for a symbol • Data formatters for everything in Objc • Custom LLDB commands
  • 137. • WWDC ’13 Session 413 • WWDC ’14 Sessions 409 & 410 • http://lldb.llvm.org/ • http://www.objc.io/issue-19/lldb-debugging.html • http://blog.ittybittyapps.com/blog/2013/11/07/ integrating-reveal-without-modifying-your-xcode- project/ • https://github.com/facebook/chisel • https://developer.apple.com/library/mac/ documentation/IDEs/Conceptual/ gdb_to_lldb_transition_guide/document/lldb-terminal- workflow-tutorial.html Resources