Search VisualAge for Java Information Go to Information Home Page Go to VisualAge for Java WWW Site

Address/Watch Breakpoint dialog box

The name of this dialog box changes depending on what you are debugging. The name of this dialog box may be Address Breakpoint or Watch Breakpoint. Select the appropriate dialog box:

 

Address Breakpoint dialog box

Use the Address Breakpoint dialog box to set a new or redefine an existing breakpoint that stops execution when a specific address is reached in your executable.

Controls and control groupings are described below. Group and subgroup names appear in italics, and control names appear in bold.

Required Parameters Use controls in this group to define where the breakpoint is placed in the program being debugged.
Address or Expression Use this field to enter an address, or an expression that evaluates to a valid execution address.

A valid execution address is the beginning address of a machine language instruction.

Optional Parameters Provides added control over when encountering a breakpoint will stop program execution.
Thread This selection list lets you choose what threads to set the breakpoint in. To select a thread ID from the list, highlight the thread where you want to set the breakpoint. This list is available only on platforms that support multithreaded programs.
Frequency Use the Frequency controls to tell the debugger when to stop on a breakpoint and when to skip it. The debugger keeps track of how many times each breakpoint is encountered. The fields in this section tell the debugger on which encounter of a breakpoint the debugger should first stop, how often it should stop, and on which encounter the debugger should no longer stop.
From Enter the first breakpoint encounter you want the debugger to stop on. For example, if you want the debugger to skip over the breakpoint the first five times it is encountered, enter "6".
To Enter the last breakpoint encounter you want the debugger to stop on. For example, if you want it to start ignoring the breakpoint after the 20th encounter, enter "20". To have it always stop on the breakpoint, enter "Infinity".
Every Enter the frequency with which you want the debugger to stop on this breakpoint. For example, if you want it to stop on only one out of every four it encounters, enter "4".
Expression You can type an expression into the this field. The execution of the program stops at the breakpoint only if the condition specified in this field tests true.

For example, if you are debugging a C++ program you could type the following:

(i==1) || (j==k) && (k!=5)

Note: Variables in a conditional expression that is associated with a function breakpoint are limited to any static or global variables known to the called function when the function is called. The expression cannot contain local or automatic variables.

Push-buttons
OK Creates the address breakpoint using the settings you specified, then closes the Address Breakpoint dialog box.
Set Creates the address breakpoint using the settings you specified, but keeps the Address Breakpoint dialog box open so you can create more breakpoints.
Default Saves the settings in the Optional Parameters group for use as default settings when you next set a new breakpoint.
Cancel Closes the Address Breakpoint dialog box without creating a new breakpoint.
Help Displays this help panel.

 

Watch Breakpoint dialog box

Use the Watch Breakpoint dialog box to set a watch breakpoint. Use this type of breakpoint when you want to see where and how a variable is being changed in your program.

Controls and control groupings are described below. Group and subgroup names appear in italics, and control names appear in bold.

Required Parameters Use controls in this group to define where the breakpoint is placed in the program being debugged.
Expression Enter a variable or expression to be watched. The maximum length of the expression is 256 characters.

For CL, COBOL, and RPG an expression is always the name of a variable.

For C/C++ an expression is the name of a variable or any other expression that resolves to a storage address, for example a dereferenced pointer.

Bytes to Monitor Select the number of bytes of a variable or expression you want to watch, up to 128.

The default value is 0 and means that the declared type length of the variable is watched.

Optional Parameters Provides added control over when encountering a breakpoint will stop program execution.
Thread This selection list lets you choose what threads to set the breakpoint in. To select a thread ID from the list, highlight the thread where you want to set the breakpoint. This list is available only on platforms that support multithreaded programs.

Note: The debugger uses this information to correctly qualify the watched expression. A watch breakpoint can be set such that it may be hit in any thread, no matter what thread it is set for. Such a thread is displayed in the Breakpoints pane as being set for every thread.

Frequency Use the Frequency controls to tell the debugger when to stop on a breakpoint and when to skip it. The debugger keeps track of how many times each breakpoint is encountered. The fields in this section tell the debugger on which encounter of a breakpoint the debugger should first stop, how often it should stop, and on which encounter the debugger should no longer stop.
From Enter the first breakpoint encounter you want the debugger to stop on. For example, if you want the debugger to skip over the breakpoint the first five times it is encountered, enter "6".
To Enter the last breakpoint encounter you want the debugger to stop on. For example, if you want it to start ignoring the breakpoint after the 20th encounter, enter "20". To have it always stop on the breakpoint, enter "Infinity".
Every Enter the frequency with which you want the debugger to stop on this breakpoint. For example, if you want it to stop on only one out of every four it encounters, enter "4".
Expression You can type an expression into the this field. The execution of the program stops at the breakpoint only if the condition specified in this field tests true.

ngcpp.gif (261 bytes)For example, if you are debugging a C++ program you could type the following:

(i==1) || (j==k) && (k!=5)
Push-buttons
OK Creates the watch breakpoint using the settings you specified, then closes the Watch Breakpoint dialog box.
Set Creates the line breakpoint using the settings you specified, but keeps the Watch Breakpoint dialog box open so you can create more breakpoints.
Default Saves the settings in the Optional Parameters group for use as default settings when you next set a new breakpoint.
Cancel Closes the Watch Breakpoint dialog box without creating a new breakpoint.
Help Displays this help panel.