Using breakpoints in the EGL debugger

This topic shows you how to use breakpoints in debugging your programs. You can manage breakpoints inside or outside of an EGL debugging session.

Prerequisites

Breakpoints are used to pause the execution of a program in the debugger. You can manage breakpoints inside or outside of an EGL debugging session. Keep the following in mind when working with breakpoints:
  • A blue marker in the left margin of the Source view indicates that a breakpoint is set and enabled.
  • A white marker in the left margin of the Source view indicates that a breakpoint is set but disabled.
  • The absence of a marker in the left margin indicates that a breakpoint is not set.

Add or remove a breakpoint

To add or remove a single breakpoint in an EGL source file you can do either of the following:

Disable or enable a breakpoint

To disable or enable a single breakpoint in an EGL source file, follow these steps:

  1. In the Breakpoint view, right-click on the breakpoint. A menu opens.
  2. Click either Enable or Disable.

You can also disable or enable a breakpoint from the Source view. Right-click the breakpoint indicator and click the appropriate option from the pop-up menu.

Create a global breakpoint condition

You can specify a condition that causes the debugger to suspend a program at the first line where the condition is true.

In the Breakpoints view, click the conditional breakpoint icon:
The conditional breakpoint icon is by itself in the second group of icons.
In the Create a global EGL condition window, enter a statement that can be evaluated as TRUE or FALSE, then click OK.
A condition is shown in the window.
The condition appears in the Breakpoints view:
The condition is shown in the Breakpoints view.

Begin the debug session. Once the condition is met, the program is suspended, and the breakpoint is disabled. You can enable the breakpoint again by selecting the check box for the condition.

For example, consider a program that contains the following for loop:
	for (i int from 1 to 10 by 1)
		syslib.writeStdout(i);
	end
You might enter the following condition in the Create a global EGL condition window:
i==5

In this case, the console displays 1 through 4, then suspends.

Add a condition to a breakpoint

To make an existing breakpoint conditional, follow these steps:
  1. Right-click a breakpoint in one of the following places:
    • The source editor
    • The Breakpoints view
  2. Right-click the breakpoint and click Breakpoint Properties.
  3. In the EGL Line Breakpoint window, select the Conditional checkbox and enter a Boolean expression in the text box below.
  4. Click OK when finished.
The breakpoint now suspends the program only when the Boolean expression evaluates to TRUE.

Remove all breakpoints

To remove all breakpoints from an EGL source file, including global breakpoints, follow these steps:

  1. Right-click any breakpoint that is displayed in the Breakpoints view. A menu opens.
  2. Click Remove All.

Feedback