3.4. Using breakpoints
Use breakpoints to pause the execution of your program at a set point in your source code. When execution reaches a breakpoint, LLDB stops the program so you can inspect its state.
Prerequisites
Procedure
To set a new breakpoint on a specific line, enter:
(lldb) breakpoint set --file <source_file_name> --line <line_number>Replace
<source_file_name>with the name of your source file and<line_number>with the line number you want to set your breakpoint at.To set a breakpoint on a specific function, enter:
(lldb) breakpoint set --name <function_name>-
Replace
<function_name>with the name of the function you want to set your breakpoint at.
-
Replace
To display a list of currently set breakpoints, enter:
(lldb) breakpoint listTo delete a breakpoint, run:
(lldb) breakpoint clear -f <source_file_name> -l <line_number>-
Replace
<source_file_name>with the name of your source file and<line_number>with line number of the breakpoint you want to delete.
-
Replace
To resume the execution of your program after it reached a breakpoint, enter:
(lldb) continueTo skip a specific number of breakpoints, enter:
(lldb) continue -i <breakpoints_to_skip>-
Replace
<breakpoints_to_skip>with the number of breakpoints you want to skip. To skip a loop, set the<breakpoints_to_skip>to match the loop iteration count.
-
Replace