| (lldb) target create <path to executable> | |
| Current executable set to <path to executable>. | |
| (lldb) settings set stop-disassembly-display never | |
| (lldb) command script import <path to lldb script> | |
| (lldb) b main.kt:14 | |
| Breakpoint 1: where = lldb_inlineArgs.kexe`kfun:#main(kotlin.Array<kotlin.String>){} + <breakpoint offset> at main.kt:14:9, address = <memory address> | |
| (lldb) r | |
| Process <process id> launched: <path to executable> | |
| Process <process id> stopped | |
| * thread #<thread id>, stop reason = breakpoint 1.1 | |
| frame #0: <frame pc> lldb_inlineArgs.kexe`kfun:#main(args=[]){} at main.kt:14:9 | |
| 11 | |
| 12 fun main(args: Array<String>) { | |
| 13 val x = 42 | |
| -> 14 foo(1, bar()) | |
| ^ | |
| 15 } | |
| (lldb) p x | |
| (int) 42 | |
| (lldb) s | |
| Process <process id> stopped | |
| * thread #<thread id>, stop reason = step in | |
| frame #0: <frame pc> lldb_inlineArgs.kexe`kfun:#bar(){}kotlin.Int at main.kt:10:1 | |
| 7 return x + y | |
| 8 } | |
| 9 | |
| -> 10 fun bar() = 24 | |
| ^ | |
| 11 | |
| 12 fun main(args: Array<String>) { | |
| 13 val x = 42 | |
| (lldb) s | |
| Process <process id> stopped | |
| * thread #<thread id>, stop reason = step in | |
| frame #0: <frame pc> lldb_inlineArgs.kexe`kfun:#main(args=[]){} at main.kt:14:12 | |
| 11 | |
| 12 fun main(args: Array<String>) { | |
| 13 val x = 42 | |
| -> 14 foo(1, bar()) | |
| ^ | |
| 15 } | |
| (lldb) s | |
| Process <process id> stopped | |
| * thread #<thread id>, stop reason = step in | |
| frame #0: <frame pc> lldb_inlineArgs.kexe`kfun:#foo(kotlin.Int;kotlin.Int;kotlin.Int){}kotlin.Int at main.kt:6:41 | |
| 3 // OUTPUT_DATA_FILE: inlineArgs.out | |
| 4 | |
| 5 | |
| -> 6 inline fun foo(x: Int, y: Int, z: Int = 5): Int { | |
| ^ | |
| 7 return x + y | |
| 8 } | |
| 9 | |
| (lldb) s | |
| Process <process id> stopped | |
| * thread #<thread id>, stop reason = step in | |
| frame #0: <frame pc> lldb_inlineArgs.kexe`kfun:#foo(kotlin.Int;kotlin.Int;kotlin.Int){}kotlin.Int at main.kt:7:12 | |
| 4 | |
| 5 | |
| 6 inline fun foo(x: Int, y: Int, z: Int = 5): Int { | |
| -> 7 return x + y | |
| ^ | |
| 8 } | |
| 9 | |
| 10 fun bar() = 24 | |
| (lldb) bt | |
| * thread #<thread id>, stop reason = step in | |
| * frame #0: <frame pc> lldb_inlineArgs.kexe`kfun:#foo(kotlin.Int;kotlin.Int;kotlin.Int){}kotlin.Int at main.kt:7:12 | |
| frame #1: <frame pc> lldb_inlineArgs.kexe`kfun:#main(args=[]){} at main.kt:14:5 | |
| (lldb) p x | |
| (int) 1 | |
| (lldb) p y | |
| (int) 24 | |
| (lldb) p z | |
| (int) 5 | |
| (lldb) q |