6.9.1 Using breakpoints

Breakpoints will cause a running program to stop when the execution reaches the line where the breakpoint was set. At that moment, control is returned to the IDE, and it is possible to continue execution.

To set a breakpoint on the current source line, use the "Debug|Breakpoint" menu entry, or press Ctrl-F8.

A list of current breakpoints can be obtained through the "Debug|Breakpoint list" menu. The breakpoint list window is shown in gure (6.11).



Figure 6.11: The breakpoint list window

PIC


In the breakpoint list window, the following things can be done:

New
Shows the breakpoint property dialog where the properties for a new breakpoint can be entered.
Edit
Shows the breakpoint property dialog where the properties of the highlighted breakpoint can be changed.
Delete
Deletes the highlighted breakpoint.

The dialog can be closed with the 'Close' button. The breakpoint properties dialog is shown in gure (6.12)



Figure 6.12: The breakpoint properties dialog

PIC


The following properties can be set:

type
function
function breakpoint. The program will stop when the function with the given name is reached.
le-line
Source line breakpoint. The program will stop when the source le with given name and line is reached;
watch
Expression breakpoint. An expression may be entered, and the program will stop as soon as the expression changes.
awatch
(access watch) Expression breakpoint. An expression that references a memory location may be entered, and the program will stop as soon as the memory indicated by the expression is accessed.
rwatch
(read watch) Expression breakpoint. An expression that references a memory location may be entered, and the program will stop as soon as the memory indicated by the expression is read.
name
Name of the function or le where to stop.
line
Line number in the le where to stop. Only for breakpoints of type le-line.
Conditions
Here an expression can be entered which must evaluate True for the program to stop at the breakpoint. The expressions that can be entered must be valid GDB expressions.
Ignore count
The number of times the breakpoint will be ignored before the program stops;

Remark:

  1. Because the IDE uses GDB to do its debugging, it is necessary to enter all expressions in uppercase on FreeBSD.
  2. Expressions that reference memory locations should be no longer than 16 bytes on linux or go32v2 on an Intel processor, since the Intel processor's debug registers are used to monitor these locations.
  3. Memory location watches will not function on Win32 unless a special patch is applied.