## Breakpoints

A breakpoint is a marker set on a specific line of source code and is designed to halt program execution when encountered by the debugger. After you set a breakpoint at a key point in the program, you can halt its execution, examine its current state, and check register and variable values. You can also change values and alter the flow of normal program execution. Setting breakpoints helps you debug your program and verify its efficiency.

A project can have multiple breakpoints set in the source code files. All breakpoints in a project are shown in the Breakpoints view. Breakpoints are enabled or disabled on the currently selected line within a source code editor by selecting the Run > Toggle Breakpoint menu option, right-clicking the marker bar in the editor and selecting Toggle Breakpoint, or by pressing CTRL-SHIFT-B.

You can set a breakpoint on any executable line of code that the debugger can resolve. Lines containing comments and other non executable code cannot be assigned a breakpoint as they are normally stripped from the compiled binary. The debugger must load the symbols for a module before it can attempt to resolve breakpoints within the module. This is most easily done using the Executables view to import a binary file, especially if the binary is not in the workspace.

When the debugger attempts to resolve a breakpoint it will result in:

- resolved — the symbols for the module are loaded and the breakpoint located in the executable that’s currently being debugged, circle icon changes to flagged icon
- resolved and moved —the breakpoint is not found in the executable at the specified point. Debugger moves breakpoint forward in the current function until a line is found that can be resolved. Breakpoint icon moved to source line matching new breakpoint location and changed to flagged icon.
- unresolved — if the symbols for the module are not loaded or the breakpoint was not able to be set within the current function. This may indicate no executable code in the source line or a deadstripped function not present in the executable. Breakpoint icon remains in unflagged state indicating unresolved status.

Breakpoints have enabled and disabled types as well as resolved and unresolved states. Table 1 explains the different breakpoint types and states.

##### Table 1 Breakpoint—type and states

Type | State | Icon | Explanation
--- | --- | --- | ---
Enabled | Unresolved |  | Indicates that the breakpoint is currently enabled but not located in the executable during a debug session. Debugger cannot halt program execution.
Enabled | Resolved |  | Indicates that the breakpoint is currently enabled and resolved for the source line. The debugger halts program execution at an enabled breakpoint.
Disabled | Unresolved |  | Indicates that the breakpoint is currently disabled but not located in the executable during a debug session. The debugger does not halt program execution at a disabled breakpoint.
Disabled | Resolved |  | Indicates that the breakpoint is currently disabled and resolved for the source line. The debugger does not halt program execution at a disabled breakpoint.

Other references

- Executables view
- Setting Breakpoints
- Enabling Breakpoints
- Disabling Breakpoints
- Clearing Breakpoints