THE UNIVERSITY OF WESTERN AUSTRALIA

Department of Computer Science

230.304 CONCURRENT PROGRAMMING

Laboratory Sheet 4 (for laboratories during week 6)

The purpose of this laboratory is to :

The java debugger

You may have already used the java debugger. It is a good tool for debugging multithreaded java programs and some of you may find it useful for debugging your project.

To use jdb, you have to compile a java program using the -g option. We will use the program Example1.java for experimenting with jdb.

Compile the program using :

javac -g Example1.java

Now the compiler will include additional information in the class file. To invoke the debugger, you have to use :

jdb Example1

Here is a list of options that you can use in the debugger. You may see all these options by invoking the help command in the debugger.

Here is a file where I have executed different commands in jdb. The lines after // are my comments.

Tasks

Amitava Datta
April, 2000