Kalimantan - Debugger

version 1.0b2
Copyright (c) 1995, DSTC

The Debugger

The debugger allows you to set breakpoints in any of the threads in a currently-running Java application, examine the source of the code being executed, inspect objects and variables using the inspector and suspend and resume the threads at will.

How To

Debug an application

  1. make sure the kalimantan bin directory is in your path
  2. invoke your application with jed instead of java (if you're running on a Windows machine, then the jed script won't work. Replace jed with java dstc.kalimantan.debug.Main in the lines both above and below).
  3. you should now have a debugger window (see window tour below), from which you may set breakpoints and run the application

Debug a remote application

  1. once again, make sure the kalimantan bin directory is in your path
  2. start the application you wish to debug using java_g instead of java. It will print a password string, like so:
    $ java_g -debug ListTest
    Agent password=amdbz
    
  3. invoke jed using the hostname and password, thusly:
    $ jed -host sequoia.dstc.edu.au -password amdbz
    
  4. if all has gone well the application and debugger should both have appeared on your screen.

Debug an applet

Do everything you need to debug an application except that instead of invoking an application, invoke the applet, thusly:

$ jed sun.applet.AppletViewer MyAppletPage.html

Window Tour

The first debugger window you see will be the thread monitor, shown below:

Thread Monitor

The left hand list shows thread groups, the right hand list shows the threads in the currently selected group. The status of the thread (suspended, running, idle, cond.waiting, etc.) is shown in parentheses.

The Run button will start the application named when the debugger was invoked. The Breakpoints button allows you to set and clear breakpoints at the start of a given method. The Show button opens a debugger on the selected thread.

Setting Breakpoints

The breakpoint dialog looks like this:

Breakpoint Manager

You set a breakpoint by filling in the class and method names and pressing Set Breakpoint. It should then appear in the list of breakpoints on the left. To remove the breakpoint, select it in this list and then press the Clear Breakpoint button.

Using the Thread Debugger

Thread Browser

Thread Control Buttons
Suspend suspends a running thread, Resume resumes a suspended thread. Don't use these buttons on threads stopped at a breakpoint (see Bugs below).

Step executes the next instruction in the current thread, descending deeper into the stack if necessary. Next behaves like Step except that it won't descend into the stack. Continue continues normal execution after a breakpoint. Don't use these buttons on threads which are suspended (see Bugs below).

Known Bugs


Tim Mansfield <timbomb@dstc.edu.au>
Ted Phelps <phelps@dstc.edu.au>