LLDB - Breakpoint Commands

Set a breakpoint at all functions named main.

(lldb) breakpoint set --name main
(lldb) br s -n main
(lldb) b main 

Set a breakpoint in file test.c at line 12.

(lldb) breakpoint set --file test.c --line 12
(lldb) br s -f test.c -l 12
(lldb) b test.c:12 

Set a breakpoint at all C++ methods whose basename is main.

(lldb) breakpoint set --method main
(lldb) br s -M main

Set a breakpoint at and object C function: -[NSString stringWithFormat:].

(lldb) breakpoint set --name "-[NSString stringWithFormat:]"
(lldb) b -[NSString stringWithFormat:]

Set a breakpoint at all Objective C methods whose selector is count.

(lldb) breakpoint set --selector count
(lldb) br s -S count

Set a breakpoint by regular expression on function name.

(lldb) breakpoint set --func-regex regular-expression
(lldb) br s -r regular-expression

Ensure that breakpoints by file and line work for #included .c/.cpp/.m files.

(lldb) settings set target.inline-breakpoint-strategy always
(lldb) br s -f foo.c -l 12

Set a breakpoint by regular expression on source file contents.

(lldb) breakpoint set --source-pattern regular-expression --file SourceFile
(lldb) br s -p regular-expression -f file

List all breakpoints.

(lldb) breakpoint list
(lldb) br l

Delete a breakpoint.

(lldb) breakpoint delete 1
(lldb) br del 1