wiki:CompilingAndDebugging

Compiling

Debugging

Ant abcl.debug.jpda target

When running the Ant target abcl.debug.jpda, a JVM is started waiting for a JDB (java debugger) to attach. On Windows (with the JDK 1.5.0_16) I need to run this command (in a different window) to attach to the session:

  $ %JDKPATH%\jdb -connect com.sun.jdi.SocketAttach:port=6789

After that, you have (command line) access to the JVM in which ABCL is running.

Using JDWP

One can use the JDWP connection to debug the JVM image with a graphical debugger such as Netbeans.

The JVM has to be started with the correct options, which is easy to build into the ABCL wrapper by placing the following in the abcl.properties file:

java.options=-agentlib:jdwp=transport=dt_socket,address=6789,server=y,suspend=n

Now, the JVM can be attached to when you wish to debug it by the "Debug >> Attach Debugger" menu options on Netbeans. If you have the abcl project open, you have a full source debugging environnment, including the ability to make Java code changes, and dynamically insert them into the running image without restarting the process.

Analyzing compiler output

In order to find errors in the output generated by the compiler, you can look at the textual .abcl or ._ files as described in FaslFormatAndLoading. There are .cls files. These are basically Java class files and can be de-compiled with JAD.

Last modified 14 years ago Last modified on 04/29/10 15:45:17