Contents | Prev | Next | Index
Canterbury Oberon-2 for JVM supports any Java debugger. The following switches or comment embedded directives for debugger support are available in this Oberon-2 compiler:
- -D or (*D+ *)
- This switch or directive causes the Oberon-2 compiler to insert local variable tables and line number tables to the class file output.
- -JDB or (*JDB+ *)
- This switch or directive does the same as -D , in addition copies of the compiled source files are created using the file extension ".obn.debug.java". These files will then be used instead of the original source files copies by the Java debugger. This is useful when a Java debugger only recognizes source files with the ".java" extension. This switch should be chosen when using the JDB utility which is part of the JDK 1.1.x or Java-2 SDK 1.2.x.
Java Application example for Windows 95/98 JDK 1.1.x:
Given the following Oberon-2 program "helloworld.obn":
MODULE helloworld;
IMPORT Out;
BEGIN
Out.String( "Hello World" );
Out.Ln;
END helloworld.
The following commands are needed for compiling and debugging:
java mhc.compiler.obn helloworld -m -jdb
jdb helloworld
The first executable line of a Java application always is at the "main" method. This is where Canterbury Oberon-2 maps the module intialization entry point. In the above example, going to the start of the program could be done in JDB by setting a first break point as follows:stop in helloworld.main
run
Java Applet example for Windows 95/98 JDK 1.1.x:
Given the "Slides.obn" example (see section A First Example), the following commands can be used for compiling and debugging the applet:
java mhc.compiler.obn Slides -m -r -jdb
jdb sun.applet.AppletViewer Slides.html
Contents | Prev | Next | Index
Canterbury Oberon-2 for JVM (Last documentation update
Jun 2, 2000)
Copyright © 1998 Mill Hill & Canterbury
Corporation, Ltd. All rights reserved
Please send any comments or corrections to
mhc@webcom.com