advanced swift debugging in lldb - apple inc. · advanced swift debugging in lldb debugging in a...
TRANSCRIPT
![Page 1: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/1.jpg)
© 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.
#WWDC14
Advanced Swift Debugging in LLDBDebugging in a Swift world
Session 410 Enrico Granata Debugger Engineer
Tools
![Page 2: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/2.jpg)
Introduction
![Page 3: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/3.jpg)
Introduction
Swift is the modern language of Cocoa
![Page 4: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/4.jpg)
Introduction
Swift is the modern language of Cocoa
Your existing tools, improved
![Page 5: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/5.jpg)
Introduction
Swift is the modern language of Cocoa
Your existing tools, improved
The debugger can help you explore in the context of your app
![Page 6: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/6.jpg)
Introduction
Swift is the modern language of Cocoa
Your existing tools, improved
The debugger can help you explore in the context of your app• And be productive
![Page 7: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/7.jpg)
Introduction
Swift is the modern language of Cocoa
Your existing tools, improved
The debugger can help you explore in the context of your app• And be productive
Swift feels awesome in LLDB
![Page 8: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/8.jpg)
What You Will Learn
![Page 9: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/9.jpg)
What You Will Learn
Swift types in LLDB
![Page 10: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/10.jpg)
What You Will Learn
Swift types in LLDB• Optional types
![Page 11: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/11.jpg)
What You Will Learn
Swift types in LLDB• Optional types
• Protocols
![Page 12: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/12.jpg)
What You Will Learn
Swift types in LLDB• Optional types
• Protocols
• Generics
![Page 13: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/13.jpg)
What You Will Learn
Swift types in LLDB• Optional types
• Protocols
• Generics
Debugging combined Swift and Objective-C
![Page 14: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/14.jpg)
What You Will Learn
Swift types in LLDB• Optional types
• Protocols
• Generics
Debugging combined Swift and Objective-C
Stepping
![Page 15: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/15.jpg)
What You Will Learn
Swift types in LLDB• Optional types
• Protocols
• Generics
Debugging combined Swift and Objective-C
Stepping
Data formatters for Swift objects
![Page 16: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/16.jpg)
What You Will Learn
Swift types in LLDB• Optional types
• Protocols
• Generics
Debugging combined Swift and Objective-C
Stepping
Data formatters for Swift objects
Name uniqueness in Swift
![Page 17: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/17.jpg)
Optional Types
![Page 18: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/18.jpg)
Optional Types
Optionals introduce indirection
![Page 19: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/19.jpg)
Optional Types
Optionals introduce indirection• Is it there? Is it not?
![Page 20: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/20.jpg)
Optional Types
Optionals introduce indirection• Is it there? Is it not?
LLDB implicitly unwraps whenever possible
![Page 21: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/21.jpg)
Optional Types
Optionals introduce indirection• Is it there? Is it not?
LLDB implicitly unwraps whenever possible
nil used consistently for the no-value situation
![Page 22: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/22.jpg)
var string: String? = "Hello WWDC14 Attendees" var rect: NSRect? = NSMakeRect(0, 0, 20, 14) var url: NSURL? = nil
Optional Types
![Page 23: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/23.jpg)
var string: String? = "Hello WWDC14 Attendees" var rect: NSRect? = NSMakeRect(0, 0, 20, 14) var url: NSURL? = nil
Optional Types
string = (Swift.String?) "Hello WWDC14 Attendees"rect = (CoreGraphics.CGRect?) origin=(x=0, y=0) size=(width=20, height=14)url = (Foundation.NSURL?) nil
![Page 24: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/24.jpg)
Double Optional
var optional: String? = nil var twice_optional: String?? = Optional.Some(nil)
![Page 25: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/25.jpg)
Double Optional
var optional: String? = nil var twice_optional: String?? = Optional.Some(nil)
By default, propagate nil upwards
optional = (Swift.String?) niltwice_optional = (swift.String) nil
![Page 26: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/26.jpg)
Raw Display(lldb) fr v -R twice_optional (Swift.String??) twice_optional = Some { Some = None {
Some = { core = {
_baseAddress = { value = 0x0000000000000000
} _countAndFlags = {
value = 0 } _owner = None {
Some = { instance_type = 0x0000000000000000
} }
} }
} }
!
![Page 27: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/27.jpg)
Raw Display(lldb) fr v -R twice_optional (Swift.String??) twice_optional = Some { Some = None {
Some = { core = {
_baseAddress = { value = 0x0000000000000000
} _countAndFlags = {
value = 0 } _owner = None {
Some = { instance_type = 0x0000000000000000
} }
} }
} }
!
![Page 28: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/28.jpg)
Raw Display(lldb) fr v -R twice_optional (Swift.String??) twice_optional = Some { Some = None {
Some = { core = {
_baseAddress = { value = 0x0000000000000000
} _countAndFlags = {
value = 0 } _owner = None {
Some = { instance_type = 0x0000000000000000
} }
} }
} }
!
![Page 29: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/29.jpg)
Raw Display(lldb) fr v -R twice_optional (Swift.String??) twice_optional = Some { Some = None {
Some = { core = {
_baseAddress = { value = 0x0000000000000000
} _countAndFlags = {
value = 0 } _owner = None {
Some = { instance_type = 0x0000000000000000
} }
} }
} }
!
![Page 30: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/30.jpg)
Raw Display(lldb) fr v -R twice_optional (Swift.String??) twice_optional = Some { Some = None {
Some = { core = {
_baseAddress = { value = 0x0000000000000000
} _countAndFlags = {
value = 0 } _owner = None {
Some = { instance_type = 0x0000000000000000
} }
} }
} }
!
![Page 31: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/31.jpg)
Types
![Page 32: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/32.jpg)
Types
What is a type?
![Page 33: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/33.jpg)
Types
What is a type?
Lots of answers
![Page 34: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/34.jpg)
Types
What is a type?
Lots of answers
a classification that determines a set of valid values and operations for data
![Page 35: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/35.jpg)
Types
What is a type?
Lots of answers
a classification that determines a set of valid values and operations for data
Data can have multiple types
![Page 36: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/36.jpg)
Static/Dynamic Types
![Page 37: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/37.jpg)
Static/Dynamic Types
var url: AnyObject = NSURL(string: “http://www.apple.com”)
Variables have a declared (aka static) type
![Page 38: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/38.jpg)
Static/Dynamic Types
var url: AnyObject = NSURL(string: “http://www.apple.com”)
Variables have a declared (aka static) type
![Page 39: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/39.jpg)
Static/Dynamic Types
var url: AnyObject = NSURL(string: “http://www.apple.com”)
Variables have a declared (aka static) type
!
url.hash
![Page 40: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/40.jpg)
Static/Dynamic Types
var url: AnyObject = NSURL(string: “http://www.apple.com”)
Variables have a declared (aka static) type
!
url.hash
Which “hash” gets called?
![Page 41: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/41.jpg)
Static/Dynamic Types
var url: AnyObject = NSURL(string: “http://www.apple.com”)
Variables have a declared (aka static) type
!
url.hash
Which “hash” gets called?
The one that matches the runtime (aka dynamic) type
![Page 42: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/42.jpg)
Dynamic Dispatchurl.hash
![Page 43: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/43.jpg)
Dynamic Dispatchtype info
ivars
url.hash
![Page 44: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/44.jpg)
Dynamic Dispatchtype info
ivars
super type info
foo
bar
hash
baz
url.hash
![Page 45: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/45.jpg)
hash { …
}
Dynamic Dispatchtype info
ivars
super type info
foo
bar
hash
baz
url.hash
![Page 46: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/46.jpg)
hash { …
}
Dynamic Dispatchtype info
ivars
super type info
foo
bar
hash
baz
What if the runtime can’t find an implementation?
url.hash
![Page 47: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/47.jpg)
hash { …
}
Dynamic Dispatchtype info
ivars
super type info
foo
bar
hash
baz
What if the runtime can’t find an implementation?
Ask the superclass
url.hash
![Page 48: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/48.jpg)
hash { …
}
Dynamic Dispatchtype info
ivars
super type info
foo
bar
hash
baz
What if the runtime can’t find an implementation?
Ask the superclass
url.hash
url.another
![Page 49: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/49.jpg)
hash { …
}
Dynamic Dispatchtype info
ivars
super type info
foo
bar
hash
baz
What if the runtime can’t find an implementation?
Ask the superclass
type info
ivars
url.hash
url.another
![Page 50: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/50.jpg)
hash { …
}
Dynamic Dispatchtype info
ivars
super type info
foo
bar
hash
baz
What if the runtime can’t find an implementation?
Ask the superclass
type info
ivars
super type info
foo
bar
hash
baz
url.hash
url.another
![Page 51: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/51.jpg)
super type info
foo
another
bar
hash
hash { …
}
Dynamic Dispatchtype info
ivars
super type info
foo
bar
hash
baz
What if the runtime can’t find an implementation?
Ask the superclass
type info
ivars
super type info
foo
bar
hash
baz
url.hash
url.another
![Page 52: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/52.jpg)
another { …
}
super type info
foo
another
bar
hash
hash { …
}
Dynamic Dispatchtype info
ivars
super type info
foo
bar
hash
baz
What if the runtime can’t find an implementation?
Ask the superclass
type info
ivars
super type info
foo
bar
hash
baz
url.hash
url.another
![Page 53: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/53.jpg)
Dynamic Types in LLDB
2 class Base {} 34 class Derived : Base { 5 var meaning = 42 6 }78 func userbase(x: Base) { 9 println("All your base are belong to us.") 10 }
![Page 54: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/54.jpg)
useBase (aDerived)
Dynamic Types in LLDB
2 class Base {} 34 class Derived : Base { 5 var meaning = 42 6 }78 func userbase(x: Base) { 9 println("All your base are belong to us.") 10 }
![Page 55: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/55.jpg)
Dynamic Types in LLDB
2 class Base {} 34 class Derived : Base { 5 var meaning = 42 6 }78 func userbase(x: Base) { 9 println("All your base are belong to us.") 10 }
![Page 56: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/56.jpg)
Dynamic Types in LLDB
2 class Base {} 34 class Derived : Base { 5 var meaning = 42 6 }78 func userbase(x: Base) { 9 println("All your base are belong to us.") 10 }9 println("All your base are belong to us.")
![Page 57: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/57.jpg)
Dynamic Types in LLDB
x = (WWDC14.Derived) 0x0000000100510000WWDC14.Base meaning = (Swift.Int) 42
2 class Base {} 34 class Derived : Base { 5 var meaning = 42 6 }78 func userbase(x: Base) { 9 println("All your base are belong to us.") 10 }9 println("All your base are belong to us.")
![Page 58: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/58.jpg)
Protocols
![Page 59: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/59.jpg)
Protocols
Protocols are types in Swift
![Page 60: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/60.jpg)
Protocols
Protocols are types in Swift• Variables can have protocol types
![Page 61: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/61.jpg)
Protocols
Protocols are types in Swift• Variables can have protocol types
• Protocols can be included in function signatures
![Page 62: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/62.jpg)
Protocols
Protocols are types in Swift• Variables can have protocol types
• Protocols can be included in function signatures
Variables of protocol type are limited
![Page 63: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/63.jpg)
Protocols
Protocols are types in Swift• Variables can have protocol types
• Protocols can be included in function signatures
Variables of protocol type are limited• To only reveal what the protocol allows
![Page 64: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/64.jpg)
Protocols
Protocols are types in Swift• Variables can have protocol types
• Protocols can be included in function signatures
Variables of protocol type are limited• To only reveal what the protocol allows
LLDB opens the curtain for you
![Page 65: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/65.jpg)
Protocols
Protocols are types in Swift• Variables can have protocol types
• Protocols can be included in function signatures
Variables of protocol type are limited• To only reveal what the protocol allows
LLDB opens the curtain for you• And it shows you the full value
![Page 66: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/66.jpg)
Protocols
protocol Creature { func speak() } !class Cat: Creature { func speak() { println("Meow. Purr") } } class Dog: Creature { func speak() { println(“Woof!”) } }
19 func atTheZoo(creature: Creature) { 20 creature.speak()21 }
![Page 67: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/67.jpg)
Protocols
19 func atTheZoo(creature: Creature) { 20 creature.speak()21 }
![Page 68: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/68.jpg)
Protocols
19 func atTheZoo(creature: Creature) { 20 creature.speak()21 } 20 creature.speak()
![Page 69: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/69.jpg)
Protocols
creature = (WWDC14.Dog) 0x0000000100510000happy = (WWDC14.Dog.Happiness) VeryHappy
19 func atTheZoo(creature: Creature) { 20 creature.speak()21 } 20 creature.speak()
![Page 70: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/70.jpg)
Protocols
![Page 71: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/71.jpg)
ProtocolsConsole users beware
![Page 72: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/72.jpg)
ProtocolsConsole users beware
(lldb) fr v creature (Creature) creature = {
payload_data_0 = 0x0000000100510000 -> 0x00000001000081c0 direct type metadata for WWDC14.Dog + 16 payload_data_1 = 0x00007fff5fbffa10 payload_data_2 = 0x0000000100002b52 WWDC14`WWDC14.play_with_hierarchy () -> () + 66 at hierarchy.swift:20 instance_type = 0x00000001000081c0 direct type metadata for WWDC14.Dog + 16 protocol_witness_0 = 0x0000000100007510 protocol witness table for WWDC14.Dog : WWDC14.Creature
}
![Page 73: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/73.jpg)
(lldb) fr v -d r creature (WWDC14.Dog) creature = 0x0000000100510000 { happy = VeryHappy
}
ProtocolsConsole users beware
(lldb) fr v creature (Creature) creature = {
payload_data_0 = 0x0000000100510000 -> 0x00000001000081c0 direct type metadata for WWDC14.Dog + 16 payload_data_1 = 0x00007fff5fbffa10 payload_data_2 = 0x0000000100002b52 WWDC14`WWDC14.play_with_hierarchy () -> () + 66 at hierarchy.swift:20 instance_type = 0x00000001000081c0 direct type metadata for WWDC14.Dog + 16 protocol_witness_0 = 0x0000000100007510 protocol witness table for WWDC14.Dog : WWDC14.Creature
}
![Page 74: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/74.jpg)
(lldb) fr v -d r creature (WWDC14.Dog) creature = 0x0000000100510000 { happy = VeryHappy
}
ProtocolsConsole users beware
(lldb) fr v creature (Creature) creature = {
payload_data_0 = 0x0000000100510000 -> 0x00000001000081c0 direct type metadata for WWDC14.Dog + 16 payload_data_1 = 0x00007fff5fbffa10 payload_data_2 = 0x0000000100002b52 WWDC14`WWDC14.play_with_hierarchy () -> () + 66 at hierarchy.swift:20 instance_type = 0x00000001000081c0 direct type metadata for WWDC14.Dog + 16 protocol_witness_0 = 0x0000000100007510 protocol witness table for WWDC14.Dog : WWDC14.Creature
}
![Page 75: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/75.jpg)
ProtocolsConsole users beware
(lldb) fr v creature (Creature) creature = {
payload_data_0 = 0x0000000100510000 -> 0x00000001000081c0 direct type metadata for WWDC14.Dog + 16 payload_data_1 = 0x00007fff5fbffa10 payload_data_2 = 0x0000000100002b52 WWDC14`WWDC14.play_with_hierarchy () -> () + 66 at hierarchy.swift:20 instance_type = 0x00000001000081c0 direct type metadata for WWDC14.Dog + 16 protocol_witness_0 = 0x0000000100007510 protocol witness table for WWDC14.Dog : WWDC14.Creature
}
(lldb) fr v -d r creature (WWDC14.Dog) creature = 0x0000000100510000 { happy = VeryHappy
}
![Page 76: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/76.jpg)
Generics
![Page 77: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/77.jpg)
Generics
Swift has native support for generics
![Page 78: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/78.jpg)
Generics
Swift has native support for generics
Type information passed to functions
![Page 79: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/79.jpg)
Generics
Swift has native support for generics
Type information passed to functions• LLDB uses it to reconstruct code’s meaning
![Page 80: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/80.jpg)
Generics1 protocol Producer { 2 typealias Element3 func produce() -> Element 4 } 56 class TheProducer: Producer {7 typealias Element = Int8 var _x: Int 9 int(_x: Int) {10 Self._x = x11 }12 func produce() -> Int { 13 return ++_x14 }15 }1617 func produce<P: Producer where P.Element == Int>(p: P, count: Int) {18 println("About to generate data")19 for i in 0..count {20 println(p.produce())21 }22 }
![Page 81: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/81.jpg)
Generics1 protocol Producer { 2 typealias Element3 func produce() -> Element 4 } 56 class TheProducer: Producer {7 typealias Element = Int8 var _x: Int 9 int(_x: Int) {10 Self._x = x11 }12 func produce() -> Int { 13 return ++_x14 }15 }1617 func produce<P: Producer where P.Element == Int>(p: P, count: Int) {18 println("About to generate data")19 for i in 0..count {20 println(p.produce())21 }22 }
19 for i in 0..count {
![Page 82: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/82.jpg)
Generics
p = (WWDC14.TheProducer) 0x0000000100510000_x = (Swift.Int) 2014count = (Swift.Int) 6$swift.type.P = (builtin.RawPointer) 0x100009410
1 protocol Producer { 2 typealias Element3 func produce() -> Element 4 } 56 class TheProducer: Producer {7 typealias Element = Int8 var _x: Int 9 init(_x: Int) {10 Self._x = x11 }12 func produce() -> Int { 13 return ++_x14 }15 }1617 func produce<P: Producer where P.Element == Int>(p: P, count: Int) {18 println("About to generate data")19 for i in 0..count {20 println(p.produce())21 }22 }
19 for i in 0..count {
![Page 83: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/83.jpg)
Generics
p = (WWDC14.TheProducer) 0x0000000100510000_x = (Swift.Int) 2014count = (Swift.Int) 6$swift.type.P = (builtin.RawPointer) 0x100009410
1 protocol Producer { 2 typealias Element3 func produce() -> Element 4 } 56 class TheProducer: Producer {7 typealias Element = Int8 var _x: Int 9 init(_x: Int) {10 Self._x = x11 }12 func produce() -> Int { 13 return ++_x14 }15 }1617 func produce<P: Producer where P.Element == Int>(p: P, count: Int) {18 println("About to generate data")19 for i in 0..count {20 println(p.produce())21 }22 }
19 for i in 0..count {
![Page 84: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/84.jpg)
Generics
p = (WWDC14.TheProducer) 0x0000000100510000_x = (Swift.Int) 2014count = (Swift.Int) 6$swift.type.P = (builtin.RawPointer) 0x100009410
1 protocol Producer { 2 typealias Element3 func produce() -> Element 4 } 56 class TheProducer: Producer {7 typealias Element = Int8 var _x: Int 9 init(_x: Int) {10 Self._x = x11 }12 func produce() -> Int { 13 return ++_x14 }15 }1617 func produce<P: Producer where P.Element == Int>(p: P, count: Int) {18 println("About to generate data")19 for i in 0..count {20 println(p.produce())21 }22 }
19 for i in 0..count {
![Page 85: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/85.jpg)
Generics
p = (WWDC14.TheProducer) 0x0000000100510000_x = (Swift.Int) 2014count = (Swift.Int) 6$swift.type.P = (builtin.RawPointer) 0x100009410
1 protocol Producer { 2 typealias Element3 func produce() -> Element 4 } 56 class TheProducer: Producer {7 typealias Element = Int8 var _x: Int 9 init(_x: Int) {10 Self._x = x11 }12 func produce() -> Int { 13 return ++_x14 }15 }1617 func produce<P: Producer where P.Element == Int>(p: P, count: Int) {18 println("About to generate data")19 for i in 0..count {20 println(p.produce())21 }22 }
19 for i in 0..count {
![Page 86: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/86.jpg)
Generics
p = (WWDC14.TheProducer) 0x0000000100510000_x = (Swift.Int) 2014count = (Swift.Int) 6$swift.type.P = (builtin.RawPointer) 0x100009410
1 protocol Producer { 2 typealias Element3 func produce() -> Element 4 } 56 class TheProducer: Producer {7 typealias Element = Int8 var _x: Int 9 init(_x: Int) {10 Self._x = x11 }12 func produce() -> Int { 13 return ++_x14 }15 }1617 func produce<P: Producer where P.Element == Int>(p: P, count: Int) {18 println("About to generate data")19 for i in 0..count {20 println(p.produce())21 }22 }
19 for i in 0..count {
![Page 87: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/87.jpg)
Debugging Optimized Swift Code
![Page 88: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/88.jpg)
Debugging Optimized Swift Code
Debug builds: Literal translation of your code
![Page 89: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/89.jpg)
Debugging Optimized Swift Code
Debug builds: Literal translation of your code
Optimized builds: Enhanced toward a goal (speed, memory…)
![Page 90: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/90.jpg)
Debugging Optimized Swift Code
Debug builds: Literal translation of your code
Optimized builds: Enhanced toward a goal (speed, memory…)
The first rule of debugging optimized code • Don’t!
![Page 91: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/91.jpg)
Debugging Optimized Swift Code
Debug builds: Literal translation of your code
Optimized builds: Enhanced toward a goal (speed, memory…)
The first rule of debugging optimized code • Don’t!
Generics may be optimized for specific typesProtocols may be devirtualized
![Page 92: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/92.jpg)
Objective-C Interop
![Page 93: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/93.jpg)
Objective-C Interop
Two main cases: • ObjC frameworks in Swift apps
• Apps with ObjC and Swift source code
![Page 94: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/94.jpg)
Objective-C Interop
Two main cases: • ObjC frameworks in Swift apps
• Apps with ObjC and Swift source code
What to expect? • Variables view
• Expression evaluation
• po
![Page 95: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/95.jpg)
Most native experience • Data shown in the type’s language of origin
• Formatters apply in all cases
Objective-C Interop: Variables View
3 func addStrings(x: String, y: NSString) -> NSString { 4 return x+y5 }
x = (Swift.String) "Hello,"y = (__NSCFString *) @"world"
![Page 96: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/96.jpg)
Objective-C Interop: Expressions
![Page 97: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/97.jpg)
Objective-C Interop: Expressions
Expressions see two separate worlds
![Page 98: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/98.jpg)
Objective-C Interop: Expressions
Expressions see two separate worlds• Objects in Swift frames only for Swift expressions
![Page 99: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/99.jpg)
Objective-C Interop: Expressions
Expressions see two separate worlds• Objects in Swift frames only for Swift expressions
• Two namespaces for your results
![Page 100: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/100.jpg)
Objective-C Interop: Expressions
Expressions see two separate worlds• Objects in Swift frames only for Swift expressions
• Two namespaces for your results
- $0, $1, … for Objective-C
- $R0, $R1, … for Swift
![Page 101: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/101.jpg)
Objective-C Interop: Expressions
![Page 102: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/102.jpg)
Objective-C Interop: Expressions
(lldb) f frame #0: 0x0000000100005de0 WWDC14`-[CocoaClass description](self=0x000000010040e940, _cmd=0x00007fff8c7eaf49) + 16 at CocoaClass.m:19
![Page 103: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/103.jpg)
Objective-C Interop: Expressions
(lldb) f frame #0: 0x0000000100005de0 WWDC14`-[CocoaClass description](self=0x000000010040e940, _cmd=0x00007fff8c7eaf49) + 16 at CocoaClass.m:19
![Page 104: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/104.jpg)
Objective-C Interop: Expressions
(lldb) f frame #0: 0x0000000100005de0 WWDC14`-[CocoaClass description](self=0x000000010040e940, _cmd=0x00007fff8c7eaf49) + 16 at CocoaClass.m:19
(lldb) p self CocoaClass *) $0 = 0x000000010040e940 (lldb) |
![Page 105: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/105.jpg)
Objective-C Interop: Expressions
(lldb) f frame #0: 0x0000000100005de0 WWDC14`-[CocoaClass description](self=0x000000010040e940, _cmd=0x00007fff8c7eaf49) + 16 at CocoaClass.m:19
(lldb) p self CocoaClass *) $0 = 0x000000010040e940 (lldb) |
(lldb) f frame #0: 0x0000000100004a1f WWDC14`WWDC14.play_with_usecocoa () -> () + 95 at usecocoa.swift:6
![Page 106: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/106.jpg)
Objective-C Interop: Expressions
(lldb) f frame #0: 0x0000000100005de0 WWDC14`-[CocoaClass description](self=0x000000010040e940, _cmd=0x00007fff8c7eaf49) + 16 at CocoaClass.m:19
(lldb) p self CocoaClass *) $0 = 0x000000010040e940 (lldb) |
(lldb) f frame #0: 0x0000000100004a1f WWDC14`WWDC14.play_with_usecocoa () -> () + 95 at usecocoa.swift:6
![Page 107: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/107.jpg)
Objective-C Interop: Expressions
(lldb) f frame #0: 0x0000000100005de0 WWDC14`-[CocoaClass description](self=0x000000010040e940, _cmd=0x00007fff8c7eaf49) + 16 at CocoaClass.m:19
(lldb) p self CocoaClass *) $0 = 0x000000010040e940 (lldb) |
(lldb) f frame #0: 0x0000000100004a1f WWDC14`WWDC14.play_with_usecocoa () -> () + 95 at usecocoa.swift:6
(lldb) p (Class) [$0 class] error: <REPL>:1:9: error: anonymous closure argument not contained in a closure (Class)[$0 class]
^ <REPL>:1:12: error: expected ',' separator (Class) [$0 class]
^
![Page 108: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/108.jpg)
Objective-C Interop: Expressions
![Page 109: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/109.jpg)
Language can be changed
Objective-C Interop: Expressions
![Page 110: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/110.jpg)
Language can be changed
Objective-C Interop: Expressions
(lldb) expr -l objc++ -- (Class)[$0 class] (Class) $2 = CocoaClass
![Page 111: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/111.jpg)
Language can be changed
Objective-C Interop: Expressions
(lldb) expr -l objc++ -- (Class)[$0 class] (Class) $2 = CocoaClass
![Page 112: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/112.jpg)
Language can be changed• But locals will not be available
Objective-C Interop: Expressions
(lldb) expr -l objc++ -- (Class)[$0 class] (Class) $2 = CocoaClass
![Page 113: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/113.jpg)
Objective-C Interop: po
po honors most native experience: • Swift objects display using formatters
• Objective-C objects use -description
![Page 114: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/114.jpg)
Objective-C Interop
class MyObject: NSObject { var myInt = 1 override var description: String! {
return "Hello Swift subclass. myInt = \(myInt)" }
}
![Page 115: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/115.jpg)
Objective-C Interop
class MyObject: NSObject { var myInt = 1 override var description: String! {
return "Hello Swift subclass. myInt = \(myInt)" }
}po uses formatters—ignores description
![Page 116: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/116.jpg)
Objective-C Interop
class MyObject: NSObject { var myInt = 1 override var description: String! {
return "Hello Swift subclass. myInt = \(myInt)" }
}po uses formatters—ignores description
(lldb) po object 0x0000000100700ea0 (ObjectiveC.NSObject = {}, myInt = 1)
![Page 117: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/117.jpg)
Objective-C Interop
class MyObject: NSObject { var myInt = 1 override var description: String! {
return "Hello Swift subclass. myInt = \(myInt)" }
}po uses formatters—ignores description
What if I want to use my description property?
(lldb) po object 0x0000000100700ea0 (ObjectiveC.NSObject = {}, myInt = 1)
![Page 118: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/118.jpg)
Objective-C Interop
(lldb) po object 0x0000000100700ea0 (ObjectiveC.NSObject = {}, myInt = 1)
(lldb) expr -l objc++ -O -- (id)0x0000000100700ea0
![Page 119: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/119.jpg)
Objective-C Interop
(lldb) po object 0x0000000100700ea0 (ObjectiveC.NSObject = {}, myInt = 1)
(lldb) expr -l objc++ -O -- (id)0x0000000100700ea0
![Page 120: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/120.jpg)
Objective-C Interop
(lldb) po object 0x0000000100700ea0 (ObjectiveC.NSObject = {}, myInt = 1)
(lldb) expr -l objc++ -O -- (id)0x0000000100700ea0
![Page 121: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/121.jpg)
Objective-C Interop
(lldb) po object 0x0000000100700ea0 (ObjectiveC.NSObject = {}, myInt = 1)
(lldb) expr -l objc++ -O -- (id)0x0000000100700ea0
![Page 122: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/122.jpg)
Objective-C Interop
(lldb) po object 0x0000000100700ea0 (ObjectiveC.NSObject = {}, myInt = 1)
(lldb) expr -l objc++ -O -- (id)0x0000000100700ea0
![Page 123: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/123.jpg)
Objective-C Interop
(lldb) po object 0x0000000100700ea0 (ObjectiveC.NSObject = {}, myInt = 1)
(lldb) expr -l objc++ -O -- (id)0x0000000100700ea0
Hello Swift subclass. myInt = 1
![Page 124: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/124.jpg)
Stepping
Stepping around Swift code • Protocols
• Closures
![Page 125: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/125.jpg)
8 func useCreature(c: Creature) {9 c.speak()10 }
Stepping: Protocols
![Page 126: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/126.jpg)
8 func useCreature(c: Creature) {9 c.speak()10 }
Stepping: Protocols
9 c.speak()
![Page 127: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/127.jpg)
8 func useCreature(c: Creature) {9 c.speak()10 }
Stepping: Protocols
9 c.speak() class Cat: Creature { func speak() { println("Meow. Purr.") }
![Page 128: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/128.jpg)
8 func useCreature(c: Creature) {9 c.speak()10 }
Stepping: Protocols
9 c.speak() class Cat: Creature { func speak() { println("Meow. Purr.") }
func useCreature(c: Creature) { c.speak() }
![Page 129: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/129.jpg)
8 func useCreature(c: Creature) {9 c.speak()10 }
Stepping: Protocols
Stepping inside protocol implementations involves a layer of dynamic dispatch (“protocol witness”)
Stepping out of the implementation steps out of the witness
9 c.speak() class Cat: Creature { func speak() { println("Meow. Purr.") }
func useCreature(c: Creature) { c.speak() }
![Page 130: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/130.jpg)
13 takeClosure(3) {14 return $0 < 515 }
Stepping: Breakpoint In a Closure
![Page 131: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/131.jpg)
13 takeClosure(3) {14 return $0 < 515 }
Stepping: Breakpoint In a Closure
14 return $0 < 5
![Page 132: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/132.jpg)
13 takeClosure(3) {14 return $0 < 515 }
Stepping: Breakpoint In a Closure
14 return $0 < 5
![Page 133: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/133.jpg)
13 takeClosure(3) {14 return $0 < 515 }
Stepping: Breakpoint In a Closure
14 return $0 < 5
![Page 134: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/134.jpg)
13 takeClosure(3) {14 return $0 < 515 }
Stepping: Breakpoint In a Closure
14 return $0 < 5
![Page 135: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/135.jpg)
Data Formatters for Swift Objects
![Page 136: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/136.jpg)
Data Formatters for Swift Objects
LLDB data formatters improve data display • Hide implementation details
• Focus on what matters
![Page 137: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/137.jpg)
Data Formatters for Swift Objects
LLDB data formatters improve data display • Hide implementation details
• Focus on what matters
LLDB formats Swift library types automatically
![Page 138: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/138.jpg)
Data Formatters for Swift Objects
LLDB data formatters improve data display • Hide implementation details
• Focus on what matters
LLDB formats Swift library types automatically
You can roll your own • Just like for C++/Objective-C
![Page 139: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/139.jpg)
Data Formatters for Swift Objects15 struct Address { 16 var name: String17 var city: String18 var zip: Int19 var state: State20 }
![Page 140: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/140.jpg)
Data Formatters for Swift Objects
(lldb)po enrico { Name = "Enrico Granata" City = "Mountain View" Zip = 94043 State = California }
15 struct Address { 16 var name: String17 var city: String18 var zip: Int19 var state: State20 }
![Page 141: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/141.jpg)
Data Formatters for Swift Objects
(lldb)po enrico { Name = "Enrico Granata" City = "Mountain View" Zip = 94043 State = California } (lldb) type summary add -s "${var.name} \n ${var.city} \n ${var.zip}, ${var.state}" WWDC14.Address
15 struct Address { 16 var name: String17 var city: String18 var zip: Int19 var state: State20 }
![Page 142: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/142.jpg)
(lldb) type summary add -s "${var.name} \n ${var.city} \n ${var.zip}, ${var.state}" WWDC14.Address
15 struct Address { 16 var name: String17 var city: String18 var zip: Int19 var state: State20 }
Data Formatters for Swift Objects
(lldb)po enrico { Name = "Enrico Granata" City = "Mountain View" Zip = 94043 State = California }
![Page 143: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/143.jpg)
(lldb) type summary add -s "${var.name} \n ${var.city} \n ${var.zip}, ${var.state}" WWDC14.Address
15 struct Address { 16 var name: String17 var city: String18 var zip: Int19 var state: State20 }
Data Formatters for Swift Objects
(lldb)po enrico { Name = "Enrico Granata" City = "Mountain View" Zip = 94043 State = California }
![Page 144: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/144.jpg)
(lldb) type summary add -s "${var.name} \n ${var.city} \n ${var.zip}, ${var.state}" WWDC14.Address
15 struct Address { 16 var name: String17 var city: String18 var zip: Int19 var state: State20 }
Data Formatters for Swift Objects
(lldb)po enrico { Name = "Enrico Granata" City = "Mountain View" Zip = 94043 State = California }
![Page 145: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/145.jpg)
(lldb) type summary add -s "${var.name} \n ${var.city} \n ${var.zip}, ${var.state}" WWDC14.Address
15 struct Address { 16 var name: String17 var city: String18 var zip: Int19 var state: State20 }
Data Formatters for Swift Objects
(lldb)po enrico { Name = "Enrico Granata" City = "Mountain View" Zip = 94043 State = California }
![Page 146: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/146.jpg)
(lldb) type summary add -s "${var.name} \n ${var.city} \n ${var.zip}, ${var.state}" WWDC14.Address
15 struct Address { 16 var name: String17 var city: String18 var zip: Int19 var state: State20 }
Data Formatters for Swift Objects
(lldb)po enrico { Name = "Enrico Granata" City = "Mountain View" Zip = 94043 State = California }
![Page 147: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/147.jpg)
15 struct Address { 16 var name: String17 var city: String18 var zip: Int19 var state: State20 }
Data Formatters for Swift Objects
(lldb)po enrico { Name = “Enrico Granata” City = “Mountain View” Zip = 94043 State = California }
(lldb)po enrico "Enrico Granata" "Mountain View" 94043, California
![Page 148: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/148.jpg)
Data Formatters for Swift Objects
![Page 149: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/149.jpg)
Data Formatters for Swift Objects
Caveats
![Page 150: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/150.jpg)
Data Formatters for Swift Objects
Caveats• Type name must be fully qualified (include module)
![Page 151: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/151.jpg)
Data Formatters for Swift Objects
Caveats• Type name must be fully qualified (include module)
• In Python, use SBValue.GetSummary()
![Page 152: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/152.jpg)
Data Formatters for Swift Objects
Caveats• Type name must be fully qualified (include module)
• In Python, use SBValue.GetSummary()
- Except for enums!
![Page 153: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/153.jpg)
UniquenessMyApp
![Page 154: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/154.jpg)
Uniqueness
Foo.framework
MyClassWithANiceName
MyApp
![Page 155: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/155.jpg)
Uniqueness
Foo.framework
MyClassWithANiceName
MyApp
Bar.framework
MyClassWithANiceName
![Page 156: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/156.jpg)
Uniqueness
![Page 157: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/157.jpg)
Uniqueness
Swift provides uniqueness • Of function overloads
• Of classes in different frameworks
![Page 158: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/158.jpg)
Uniqueness
Swift provides uniqueness • Of function overloads
• Of classes in different frameworks
Mangled names are the way
![Page 159: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/159.jpg)
Uniqueness
Module2.swiftclass MyClass {…}
Module1.swiftclass MyClass {…}
![Page 160: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/160.jpg)
Uniqueness
Module2.swiftclass MyClass {…}
Swift Compiler
Module1.swiftclass MyClass {…}
![Page 161: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/161.jpg)
Uniqueness
Module2.swiftclass MyClass {…}
Swift Compiler
Module1.swiftclass MyClass {…}
![Page 162: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/162.jpg)
Uniqueness
Module2.swiftclass MyClass {…}
Swift Compiler
Module1_TtC7Module17MyClass
Module1.swiftclass MyClass {…}
![Page 163: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/163.jpg)
Uniqueness
Swift Compiler
Module1_TtC7Module17MyClass
Module2_TtC7Module27MyClass
Module1.swiftclass MyClass {…}
Module2.swiftclass MyClass {…}
![Page 164: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/164.jpg)
Uniqueness
![Page 165: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/165.jpg)
Uniqueness
What if you encounter a mangled name?
![Page 166: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/166.jpg)
Uniqueness
What if you encounter a mangled name?
Enter swift-demangle!
![Page 167: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/167.jpg)
Uniqueness
What if you encounter a mangled name?
Enter swift-demangle!$ xcrun swift-demangle _TF5MyApp6myFuncFTSiSi_TSS_
![Page 168: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/168.jpg)
Uniqueness
What if you encounter a mangled name?
Enter swift-demangle!$ xcrun swift-demangle _TF5MyApp6myFuncFTSiSi_TSS_
_TF5MyApp6myFuncFTSiSi_TSS_ ---> MyApp.myFunc (Swift.Int, Swift.Int) -> (Swift.String)
![Page 169: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/169.jpg)
Modules
MyApp.swift
![Page 170: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/170.jpg)
Modules
MyApp.swift
Swift Compiler
![Page 171: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/171.jpg)
Modules
Swift CompilerMyApp.swift
![Page 172: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/172.jpg)
Modules
Swift Compiler
MyApp.swift
MyApp Module
MyApp.app
![Page 173: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/173.jpg)
Modules
Swift Compiler
MyApp.swift LLDB
Swift Compiler
MyApp Module
MyApp.app
![Page 174: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/174.jpg)
Modules
Swift Compiler
MyApp.swift LLDB
Swift CompilerMyApp Module
MyApp.app
![Page 175: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/175.jpg)
Modules
Modules store the compiler’s truth • No need to reconstruct types from DWARF
• No loss of information
Swift Compiler
MyApp.swift LLDB
Swift CompilerMyApp Module
MyApp.app
![Page 176: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/176.jpg)
Modules
Modules store the compiler’s truth • No need to reconstruct types from DWARF
• No loss of information
LLDB can see types and functions your program doesn’t use • Yes, generics too!
Swift Compiler
MyApp.swift LLDB
Swift CompilerMyApp Module
MyApp.app
![Page 177: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/177.jpg)
Summary
![Page 178: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/178.jpg)
Summary
Choose your language
![Page 179: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/179.jpg)
Summary
Choose your language
LLDB provides helpful investigation tools
![Page 180: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/180.jpg)
Summary
Choose your language
LLDB provides helpful investigation tools
We talked about: • Swift types in LLDB
• Stepping
• Data formatters
• Modules
![Page 181: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/181.jpg)
Summary
Choose your language
LLDB provides helpful investigation tools
We talked about: • Swift types in LLDB
• Stepping
• Data formatters
• Modules
Your feedback matters!
![Page 182: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/182.jpg)
More Information
Dave DeLong Developer Tools Evangelist [email protected]
Documentation Apple Developer Forums http://devforums.apple.com
LLDB Website http://lldb.llvm.org
![Page 183: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/183.jpg)
Related Sessions
• Debugging in Xcode 6 Marina Wednesday 10:15AM
• Introduction to LLDB and the Swift REPL Mission Thursday 10:15AM
• Advanced Swift Presidio Thursday 11:30AM
![Page 184: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/184.jpg)
Labs
• Swift Lab Tools Lab A Friday 9:00AM
• LLDB and Xcode Debugging Lab Tools Lab B Friday 9:00AM
![Page 185: Advanced Swift Debugging in LLDB - Apple Inc. · Advanced Swift Debugging in LLDB Debugging in a Swift world Session 410 Enrico Granata Debugger Engineer Tools. Introduction. Introduction](https://reader030.vdocument.in/reader030/viewer/2022040616/5f12def39c4bcf23390d08cb/html5/thumbnails/185.jpg)