Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$ sh build.sh
(lldb) target create "out/main"
Current executable set to 'out/main' (x86_64).
(lldb) command source -s 0 'lldb_commands'
Executing commands in '/Users/dmishe/work/swift_sample/lldb_commands'.
(lldb) b foo.swift:5
Breakpoint 1: where = main`Foo.Foo.foo () -> Swift.Int + 13 at foo.swift:5, address = 0x00000001000018ed
(lldb) b bar.swift:5
Breakpoint 2: where = main`Bar.Bar.bar () -> Swift.Int + 13 at bar.swift:5, address = 0x0000000100001b1d
(lldb) r
2016-09-14 12:19:46.441 main[6372:64833226] Hello, World!
Process 6372 stopped
* thread #1: tid = 0x3dd46ca, 0x00000001000018ed main`Foo.foo(self=0x0000000100d00070) -> Int + 13 at foo.swift:5, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00000001000018ed main`Foo.foo(self=0x0000000100d00070) -> Int + 13 at foo.swift:5
2
3 @objc public class Foo: NSObject {
4 public func foo() -> Int {
-> 5 return 4
6 }
7 }
Process 6372 launched: '/Users/dmishe/work/swift_sample/out/main' (x86_64)
(lldb) frame variable self
(Foo.Foo) self = 0x0000000100d00070 {
ObjectiveC.NSObject = {
isa = Foo.Foo
}
}
(lldb) c
2016-09-14 12:19:46.544 main[6372:64833226] Foo = 4
Process 6372 resuming
Process 6372 stopped
* thread #1: tid = 0x3dd46ca, 0x0000000100001b1d main`Bar.bar(self=<unavailable>) -> Int + 13 at bar.swift:5, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1
frame #0: 0x0000000100001b1d main`Bar.bar(self=<unavailable>) -> Int + 13 at bar.swift:5
2
3 @objc public class Bar: NSObject {
4 public func bar() -> Int {
-> 5 return 8
6 }
7 }
(lldb) frame variable self
self = <could not resolve type>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment