| |||
| Home > ARM Debuggers for Windows and UNIX > Breakpoints, watchpoints, and stepping > Simple breakpoints | |||
A breakpoint is a point in the code where your program is halted by the ARM Debugger. When you set a breakpoint it is marked in red in the left pane of the breakpoints window.
There are two types of breakpoint:
a simple breakpoint that stops at a particular point in your code
a complex breakpoint that:
stops when the program has passed the specified point a number of times
stops at the specified point only when an expression is true.
You can set a breakpoint at a point in the source, or in the disassembled code if it is currently being displayed. To display the disassembled code, either:
select Toggle Interleaving from the Options menu to display interleaved source and assembly language in the Execution window
select Disassembly... from the View menu to display the Disassembly window.
You can also set breakpoints on individual statements on a line, if that line contains more than one statement.
You can set, edit, or delete breakpoints in the following windows:
Execution
Disassembly
Source File
Backtrace
Breakpoints
Function Names
Low Level Symbols
Class View (if C++ is installed).
There are two methods you can use to set a simple breakpoint:
Method 1
Double click on the line where you want to set the breakpoint.
Click the OK button in the dialog box that appears.
Method 2
Position the cursor in the line where you want to set the breakpoint.
Set the breakpoint in any of the following ways:
select Toggle Breakpoint from the Execute menu
click the Toggle breakpoint button
press the F9 key.
A new breakpoint is displayed as a red marker in the left pane of the Execution window, the Disassembly window, or the Source File window.
In a line with several statements you can set a breakpoint on an individual statement, as demonstrated in the following example:
int main()
{
hello(); world();
.
.
.
return 0;
}
If you position the cursor on the word world and
click the Toggle breakpoint button, hello() is
executed, and execution halts before world() is
executed.
To see all the breakpoints set in your executable image select Breakpoints from the View menu.
To set a simple breakpoint on a function:
Display a list of function names in the Function Names window by selecting Function Names from the View menu.
Select Toggle Breakpoint from the Function Names window menu or click the Toggle breakpoint button.
The breakpoint is set at the first statement of the function. This method also works for the Low Level Symbols window, but the breakpoint is set to the first machine instruction of the function, that is, at the beginning of its entry sequence.
There are several methods of removing a simple breakpoint:
Method 1
Double click on a line containing a breakpoint (highlighted in red) in the Execution window.
Click the Delete button in the dialog box that appears.
Method 2
Single click on a line containing a breakpoint (highlighted in red) in the Execution window.
Right click on the line.
Select Toggle breakpoint from the pop-up menu that is displayed.
Method 3
Single click on a line containing a breakpoint (highlighted in red) in the Execution window.
Click the Toggle breakpoint button in the toolbar, or press the F9 key.
Method 4
Select Breakpoints from the View menu to display a list of breakpoints in the Breakpoint window.
Select the breakpoint you want to remove.
Click the Toggle breakpoint button or press the Delete key.
Method 5
Select Delete All Breakpoints from the Execute menu to delete all breakpoints that are set in the currently selected image. Delete All Breakpoints is also available in relevant window menus.