Exforsys

WebSphere Tutorials

  1. WebSphere V5.0 : Building Expressions
  2. WebSphere V5.0 : Creating SQL statements
  3. WebSphere V5.0 : Applying DDL scripts to a remote database
  4. WebSphere V5.0 : Deploying to the database
  5. WebSphere V5.0 : Defining a table
  6. WebSphere V5.0 : Defining a database
  7. Working with Data in WebSphere
  8. WebSphere V5.0 : Debugging - JSP debugging
  9. WebSphere V5.0 : Debugging - Scrapbook Page
  10. WebSphere V5.0 : Debugging - View variables
  11. WebSphere V5.0 : Debugging - Step-through code
  12. WebSphere V5.0 : Debugging - Set breakpoints
  13. WebSphere V5.0 : Running Applications - Export J2EE applications
  14. WebSphere V5.0 : Running Applications - Run/operate server
  15. WebSphere V5.0 : Running Applications - Understand Session Manager
  16. WebSphere V5.0 : Running Applications - Configure data sources
  17. WebSphere V5.0 : Running Applications - Create server instance and server configuration
  18. WebSphere V5.0 : Web Development - Use Web Page Wizards
  19. WebSphere V5.0 : Web Development - Work with Web Application Deployment Descriptor
  20. WebSphere V5.0 : Web Development - Use content assist
  21. WebSphere V5.0 : Web Development - Use Page Designer to add and modify HTML and JSP content
  22. WebSphere V5.0 : Web Development - Understand classpath and module dependencies
  23. WebSphere V5.0 : Web Development - Create resources in appropriate J2EE locations
  24. WebSphere V5.0 : Web Development - Create a web project
  25. WebSphere V5.0 : Java Development - Use property dialogues
  26. WebSphere V5.0 : Java Development - Use hierarchy view
  27. WebSphere V5.0 : Java Development - Use task view
  28. WebSphere V5.0 : Java Development - Use search function
  29. WebSphere V5.0 : Java Development - Use content assist function and declarations
  30. WebSphere V5.0 : Java Development - Use refactoring features
  31. WebSphere V5.0 : Java Development - Use Outline View and Browsing View
  32. WebSphere V5.0 : Java Development - Create Java project, packages, classes, methods
  33. WebSphere V5.0 : Workbench Basics - Use the Help feature to aid in development activities
  34. WebSphere V5.0 : Workbench Basics - Import to and export from the workbench
  35. WebSphere V5.0 : Workbench Basics - Work with Perspectives
  36. WebSphere V5.0 : Workbench Basics - Set workbench preferences
  37. WebSphere V5.0 : Workbench Basics - Create J2EE projects

Ads


Home arrow Reviews arrow WebSphere Tutorials

WebSphere V5.0 : Debugging - Set breakpoints

Author : Exforsys Inc.     Published on: 26th May 2006

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.

Ads

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:

Add Breakpoint

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

A new breakpoint marker

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

Breakpoints

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.

Debug

Enabling and disabling breakpoints

Do one of the following sets of tasks:

  1. In the editor area, open the file where you want to enable or disable a breakpoint.
  2. 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.

Disable 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:

Disabled Breakpoint

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.

Properties

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.

  1. Select the breakpoint to which a hit count is to be added.
  2. From the breakpoint's pop-up menu, select Hit Count:


Hit Count

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

Set Breakpoint Hit Count

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.

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.


Thread execution suspends

Ads

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.



 
This tutorial is part of a WebSphere Tutorials tutorial series. Read it from the beginning and learn yourself.

WebSphere Tutorials

  1. WebSphere V5.0 : Building Expressions
  2. WebSphere V5.0 : Creating SQL statements
  3. WebSphere V5.0 : Applying DDL scripts to a remote database
  4. WebSphere V5.0 : Deploying to the database
  5. WebSphere V5.0 : Defining a table
  6. WebSphere V5.0 : Defining a database
  7. Working with Data in WebSphere
  8. WebSphere V5.0 : Debugging - JSP debugging
  9. WebSphere V5.0 : Debugging - Scrapbook Page
  10. WebSphere V5.0 : Debugging - View variables
  11. WebSphere V5.0 : Debugging - Step-through code
  12. WebSphere V5.0 : Debugging - Set breakpoints
  13. WebSphere V5.0 : Running Applications - Export J2EE applications
  14. WebSphere V5.0 : Running Applications - Run/operate server
  15. WebSphere V5.0 : Running Applications - Understand Session Manager
  16. WebSphere V5.0 : Running Applications - Configure data sources
  17. WebSphere V5.0 : Running Applications - Create server instance and server configuration
  18. WebSphere V5.0 : Web Development - Use Web Page Wizards
  19. WebSphere V5.0 : Web Development - Work with Web Application Deployment Descriptor
  20. WebSphere V5.0 : Web Development - Use content assist
  21. WebSphere V5.0 : Web Development - Use Page Designer to add and modify HTML and JSP content
  22. WebSphere V5.0 : Web Development - Understand classpath and module dependencies
  23. WebSphere V5.0 : Web Development - Create resources in appropriate J2EE locations
  24. WebSphere V5.0 : Web Development - Create a web project
  25. WebSphere V5.0 : Java Development - Use property dialogues
  26. WebSphere V5.0 : Java Development - Use hierarchy view
  27. WebSphere V5.0 : Java Development - Use task view
  28. WebSphere V5.0 : Java Development - Use search function
  29. WebSphere V5.0 : Java Development - Use content assist function and declarations
  30. WebSphere V5.0 : Java Development - Use refactoring features
  31. WebSphere V5.0 : Java Development - Use Outline View and Browsing View
  32. WebSphere V5.0 : Java Development - Create Java project, packages, classes, methods
  33. WebSphere V5.0 : Workbench Basics - Use the Help feature to aid in development activities
  34. WebSphere V5.0 : Workbench Basics - Import to and export from the workbench
  35. WebSphere V5.0 : Workbench Basics - Work with Perspectives
  36. WebSphere V5.0 : Workbench Basics - Set workbench preferences
  37. WebSphere V5.0 : Workbench Basics - Create J2EE projects
 

Comments