Reviews
WebSphere TutorialsWebSphere V5.0 : Debugging - Set breakpoints
WebSphere V5.0 : Debugging - Set breakpoints
In this tutorial you will learn about WebSphere V5.0 : Debugging - Set breakpoints, Adding breakpoints, Enabling and disabling breakpoints, Editing breakpoint properties, Applying hit counts and Managing conditional breakpoints.
Adding breakpoints
Line breakpoints are set on an executable line of a program.
1. In the editor area, open the file where you want to add the breakpoint.
.
2. Directly to the left of the line where you want to add the breakpoint, double-click the marker bar directly to the left of the line where you want to add the breakpoint or open the marker bar pop-up menu and select Add Breakpoint:

A new breakpoint marker appears on the marker bar, directly to the left of the line where you added the breakpoint.

Also, the new breakpoint appears in the Breakpoints view list.

While the breakpoint is enabled, thread execution suspends before that line of code is executed. The debugger selects the thread that has suspended and displays the stack frames on that thread's stack. The line where the breakpoint was set is highlighted in the editor in the Debug perspective.

Enabling and disabling breakpoints
Do one of the following sets of tasks:
- In the editor area, open the file where you want to enable or disable a breakpoint.
- Directly to the left of the line where you want to add the breakpoint, open the marker bar pop-up menu and select Enable Breakpoint or Disable Breakpoint depending on the current state of the breakpoint.

OR
- In the Breakpoints view select the breakpoint(s) to be enabled or disabled.
- In the context menu of the view, select Enable or Disable.
If the breakpoint is enabled, its image will be a blue circle and if it is disabled the image will be a white circle:

While the breakpoint is enabled, thread execution suspends before that line of code is executed. The debugger selects the thread that has suspended and displays the stack frames on that thread's stack. The line where the breakpoint was set is highlighted in the editor in the Debug perspective.
Editing breakpoint properties
You can edit the following properties of line, address, watch, load, and entry breakpoints:
- Which threads the breakpoint applies to.
- How often the debugger should skip the breakpoint (the frequency).
- Whether to stop on the breakpoint only when a given expression is true (where any non-zero value is true). Expressions can only be applied to the following breakpoints:
- entry breakpoints
- address breakpoints
- line breakpoints
- You can edit required breakpoint information, as follows:
- You can edit the address of an address breakpoint.
- You can edit the function or entry point of an entry breakpoint.
- You can edit the library name of a load breakpoint.
- You can edit the address or expression and the number of bytes to watch for a watch breakpoint.
To change a breakpoint's properties:
In the Breakpoints view, right-click on the breakpoint you want to modify.
Select Properties... from the pop-up menu. The Breakpoint Properties dialog corresponding to the breakpoint type appears displaying the current settings for the breakpoint.

3. When you have made all desired changes, click Ok.
Applying hit counts
A hit count can be applied to line breakpoints, exception breakpoints, watchpoints and method breakpoints. When a hit count is applied to a breakpoint, the breakpoint suspends execution of a thread the n-th time it is hit, but never again, until it is re-enabled or the hit count is changed or disabled.
- Select the breakpoint to which a hit count is to be added.
- From the breakpoint's pop-up menu, select Hit Count:

3. In the Set Breakpoint Hit Count field, type the number of times you want to hit the breakpoint before suspending execution.

NOTE: When the breakpoint is hit for the n-th time, the thread that hit the breakpoint suspends. The breakpoint is disabled until either it is re-enabled or its hit count is changed.
Managing conditional breakpoints
To set a condition on a breakpoint:
1. Do one of the following sets of tasks:
- From the editor area:
a. In the editor area, open the file where you want to set a condition for a breakpoint.
b. From the breakpoint's pop-up menu, select Breakpoint Properties....
. - From the Breakpoints view:
a. In the Breakpoints view select the breakpoint to set the condition for
b. In the context menu of the view, select Properties....
2. The Breakpoint Properties dialog will open.
3. In the properties dialog, check the Enable Condition checkbox. To disable the condition, uncheck this checkbox.
4. In the Condition field enter the boolean expression for the breakpoint condition.

5. Click Ok to close the dialog and commit the changes.
While the breakpoint is enabled, thread execution suspends before that line of code is executed if the breakpoint condition evaluates to true. The debugger selects the thread that has suspended and displays the stack frames on that thread's stack. The line where the breakpoint was set is highlighted in the editor in the Debug perspective.

A conditional breakpoint has a question mark overlay on the breakpoint icon.
_________________
Author: Mikalai Zaikin. Please Click Here to visit Authors site for any updates and changes to the study notes.
WebSphere Tutorials
- WebSphere V5.0 : Building Expressions
- WebSphere V5.0 : Creating SQL statements
- WebSphere V5.0 : Applying DDL scripts to a remote database
- WebSphere V5.0 : Deploying to the database
- WebSphere V5.0 : Defining a table
- WebSphere V5.0 : Defining a database
- Working with Data in WebSphere
- WebSphere V5.0 : Debugging - JSP debugging
- WebSphere V5.0 : Debugging - Scrapbook Page
- WebSphere V5.0 : Debugging - View variables
- WebSphere V5.0 : Debugging - Step-through code
- WebSphere V5.0 : Debugging - Set breakpoints
- WebSphere V5.0 : Running Applications - Export J2EE applications
- WebSphere V5.0 : Running Applications - Run/operate server
- WebSphere V5.0 : Running Applications - Understand Session Manager
- WebSphere V5.0 : Running Applications - Configure data sources
- WebSphere V5.0 : Running Applications - Create server instance and server configuration
- WebSphere V5.0 : Web Development - Use Web Page Wizards
- WebSphere V5.0 : Web Development - Work with Web Application Deployment Descriptor
- WebSphere V5.0 : Web Development - Use content assist
- WebSphere V5.0 : Web Development - Use Page Designer to add and modify HTML and JSP content
- WebSphere V5.0 : Web Development - Understand classpath and module dependencies
- WebSphere V5.0 : Web Development - Create resources in appropriate J2EE locations
- WebSphere V5.0 : Web Development - Create a web project
- WebSphere V5.0 : Java Development - Use property dialogues
- WebSphere V5.0 : Java Development - Use hierarchy view
- WebSphere V5.0 : Java Development - Use task view
- WebSphere V5.0 : Java Development - Use search function
- WebSphere V5.0 : Java Development - Use content assist function and declarations
- WebSphere V5.0 : Java Development - Use refactoring features
- WebSphere V5.0 : Java Development - Use Outline View and Browsing View
- WebSphere V5.0 : Java Development - Create Java project, packages, classes, methods
- WebSphere V5.0 : Workbench Basics - Use the Help feature to aid in development activities
- WebSphere V5.0 : Workbench Basics - Import to and export from the workbench
- WebSphere V5.0 : Workbench Basics - Work with Perspectives
- WebSphere V5.0 : Workbench Basics - Set workbench preferences
- WebSphere V5.0 : Workbench Basics - Create J2EE projects







