Breakpoints are the main way to interrupt your running program for inspection at specific points. We can create, modify, delete, or list breakpoints through LLDB.
We use the breakpoint set
command to create a breakpoint:
4> func sayHello(){ 5. print("Hi") 6. } 7> sayHello() Hi 8> :breakpoint set --name sayHello Breakpoint 1: where = $__lldb_expr5`__lldb_expr_4.sayHello () -> () + 4 at repl.swift:5, address = 0x00000001005c6064
We use the breakpoint list
command to list the names and locations of breakpoints in a program:
(lldb) breakpoint list Current breakpoints: 1: name = 'sayHello', locations = 1, resolved = 1, hit count = 1 1.1: where = $__lldb_expr5`__lldb_expr_4.sayHello () -> () + 4 at repl.swift:5, address = 0x00000001005c6064, resolved, hit count = 1