Bean Extender Guide to Features


The Debugger

The debugger allows you to debug your Java code at the source level. You can use the debugger to set breakpoints and view source variables, stacks, and threads. The debugger is implemented using the APIs in the package sun.tools.debug. The debugger is a sample of how to use the debugger APIs. It is not intended to be a product-level debugger. It debugs Java source code that has a main method. It cannot debug applets. The features of the debugger are as follows:
Breakpoints You can control how your program executes by setting breakpoints. A breakpoint stops the execution of your program at a specific location.
Call Stack Window The Call Stack window lists the active functions. The functions are displayed in the order that they were called.
Variables Window The Variables window lists the variables for the current execution point. The contents of the Variables window change each time your program enters or leaves a function.
Debugger Console The Debugger Console displays debugger-generated messages and output from System.out.println statements.

Installing the Debugger

The debugger is a packaged zip file. Copy and unzip the file onto your computer and add the zip file to your CLASSPATH environment variable.

Starting a Debugging Session

To start the debugger, type the following line at a command prompt.

java com.ibm.beans.tools.debugger.BeanDbgMain
The Title Bar contains several buttons. Each icon with its corresponding action is in the following list.
* Figure debug02 not displayed. The Split Vertical button lets you control how a panel is split. Select the panel you want to split and click on the button. The panel is split vertically.
* Figure debug03 not displayed. The Split Horizontal button lets you control how a panel is split. Select the panel you want to split and click on the button. The panel is split horizontally.
* Figure debug04 not displayed. The Debugger Console button adds a panel containing the debugger console.
* Figure debug05 not displayed. The Source button adds the source panel to the debugger window.
* Figure debug06 not displayed. The Variable button adds the panel that displays the variables for the current execution point.
* Figure debug07 not displayed. The Stack button adds the panel that displays the current call stack.
* Figure debug08 not displayed. The Threads button adds the panel that displays the current threads.
* Figure debug09 not displayed. The Step button executes the current line of the program. If the current line is a call, execution is halted at the first statement in the called function.
* Figure debug10 not displayed. The Next button executes the current line in the program. If the current line is a call, execution is halted when the call is completed.
* Figure debug11 not displayed. The Continue button continues executing the program until the next breakpoint occurs or until the end of the program is reached.
* Figure debug12 not displayed. The Debug button starts the debugger. When you click on this button, the following process starts:
  1. A Class entry field appears on the Title Bar. In this field, type the class name to be debugged and press Enter.
  2. An Argument entry field replaces the Class entry field. In this field, type your arguments, and press Enter. If you have no arguments, click anywhere in the entry field and press Enter.

Viewing Source and Setting Breakpoints

The Source panel allows you to view the program you are debugging. The Source panel shows both the source and the line numbers. In the following example, the system is stopped at line 8 and a breakpoint is set on line 13.
* Figure debug15 not displayed.

To set or remove a breakpoint, double click on the line number.

Viewing the Call Stack

The Call Stack window displays the current call stack. The following figure shows an example of a Call Stack Window.
* Figure debug16 not displayed.

Viewing Variables

The Variable panel displays the variables for the current execution point. The following figure is an example of the Variable panel.
* Figure debug17 not displayed.

Viewing the Debugger Console

The Debugger Console displays messages from the debugger and output from the System.out.println statements. The following figure is the Debugger Console.
* Figure debug18 not displayed.

Viewing Threads

The Threads panel displays the thread at the current execution point. The panel shows the thread for the system, main program, and the running programs. Click on the plus (+) to expand or on the minus (-) to collapse each category.

The following figure is the Threads panel.
* Figure debug19 not displayed.

Saving the Session

The Debugger saves its state automatically when it is closed. This file is saved in a file named beanDbgSave. The window layout and breakpoints are saved.


[ Top of Page | Previous Page | Next Page | Table of Contents | Documentation Homepage ]