Skip to content

Instantly share code, notes, and snippets.

@vvlevchenko
Created November 14, 2018 10:55
Show Gist options
  • Save vvlevchenko/3e054eca64822043e8e2aa80f5cc5fc8 to your computer and use it in GitHub Desktop.
Save vvlevchenko/3e054eca64822043e8e2aa80f5cc5fc8 to your computer and use it in GitHub Desktop.
(lldb) b -f 1.kt -l 2
Breakpoint 1: where = program.kexe`kfun:main() + 4 at 1.kt:2, address = 0x00000001000089a4
(lldb) r
Process 88697 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00000001000089a4 program.kexe`kfun:main() at 1.kt:2
1 fun main() {
-> 2 println("Hello!")
3 }
Target 0: (program.kexe) stopped.
Process 88697 launched: '/Users/minamoto/ws/kotlin-native/program.kexe' (x86_64)
(lldb) n
Hello!
Process 88697 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
frame #0: 0x00000001000089b0 program.kexe`kfun:main() at 1.kt:3
1 fun main() {
2 println("Hello!")
-> 3 }
Target 0: (program.kexe) stopped.
(lldb) n
Process 88697 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
frame #0: 0x0000000100008996 program.kexe`EntryPointSelector + 6
program.kexe`EntryPointSelector:
-> 0x100008996 <+6>: popq %rax
0x100008997 <+7>: retq
0x100008998 <+8>: nopl (%rax,%rax)
program.kexe`kfun:main():
0x1000089a0 <+0>: pushq %rbp
Target 0: (program.kexe) stopped.
(lldb) n
Process 88697 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over
frame #0: 0x0000000100008997 program.kexe`EntryPointSelector + 7
program.kexe`EntryPointSelector:
-> 0x100008997 <+7>: retq
0x100008998 <+8>: nopl (%rax,%rax)
program.kexe`kfun:main():
0x1000089a0 <+0>: pushq %rbp
0x1000089a1 <+1>: movq %rsp, %rbp
Target 0: (program.kexe) stopped.
(lldb) c
Process 88697 resuming
Process 88697 exited with status = 0 (0x00000000)
0:ws-jb-kotlin-native:minamoto@unit-703(0)# cat 1.kt
fun main() {
println("Hello!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment