Setting Breakpoints in External Classes (Integrated Debugger)

The VisualAge for Java IDE can run programs that dynamically load and run external classes.  External classes are classes that have not been imported into the workspace, but rather reside in a .class file, Zip file, or Jar file on the file system.  The path to the file must be part of the class path for the program. 

If you want to debug such a program, you have the option of setting breakpoints on methods in the external classes. 

To set a breakpoint on a method in an external class:

  1. Select Debug > External .class file breakpoints from the Window menu, or click the External Breakpoints toolbar button extbp.gif (1029 bytes) in the Debugger browser.
  2. The External Method Breakpoints dialog shows a list of methods available for setting breakpoints.  Add methods to the list by clicking Add.
  3. The Add External Methods dialog looks into .class and archive files and lets you select methods within those files to add to the list of methods available for setting breakpoints.  To access methods in a .class file:
    1. Click Directory.
    2. Browse through the file system to the directory that contains the .class files in which you want to set breakpoints.

    To access methods in a .class file that has been archived:

    1. Click Archive.
    2. Select Zip Files (*.zip) or Jar Files (*.jar) in the Files of Type drop-down list.
    3. Browse to the archive file that contains the .class files in which you want to set breakpoints.

    Now, the dialog lists all the .class files in the selected directory or archive.   Select one to see the list of methods available for setting breakpoints. 

  4. If you want to add one of the listed methods to the list of methods available for setting breakpoints, enable its check-box.
  5. When you have selected all the methods you want, click OK.  The list of methods in the External Method Breakpoints list now shows the methods you selected. 
  6. To set a breakpoint on one of these methods, enable its check-box.  The breakpoint is not enabled simply by the method being listed in this box; its check-box must be enabled for the breakpoint to be set.
  7. Click OK to exit the dialog.

Once the breakpoint is set, any thread that calls it will be suspended when the method is entered.  External breakpoints cannot be conditional and do not display the breakpoint symbol in the source pane margin.

Putting Source Code on the Debug Source Path
If the source code for the method is available on the file system, and if the path to the source code is included either in the class path or in the debug source path (set in the Debugger Options), you will be able to step into the method code.  The debugger looks for the source code first in the class path, and if it cannot find it there, then in the debug source path.

If the source is not available (not on either the class path or the debug source path), you will only be able to step over the method.

Clearing Breakpoints on External Methods
To clear a breakpoint from an external method, clear its check-box in the External Method Breakpoints dialog.  You may leave the method on the list so that it is easily accessible if you want to set the breakpoint again later.  If you want to remove it from the list, however, select it and click Remove.

ngrelc.gif (533 bytes)
The Integrated Debugger

ngrelt.gif (466 bytes)
Setting Breakpoints in Source Code
Clearing and Disabling Breakpoints
Stepping Through Methods
Setting Debugger Options