Thursday, June 5, 2008

Debugging Jato

In last few weeks , while working on arraylength bytecode instruction , I had to debug Jato . But instruction provided in readme file is rather obsolete . So I had to go through the run-suite.sh and ''reinvent the wheel" .

To debug , you have to point gnu.classpath.boot.library.path to <gnu_classpath_root>/lib/classpath and bootclasspath should contain <gnu_classpath_root>/share/classpath/glibj.zip and <jato_root>/lib/classes.zip.

The easiest way to do so is , setting the following values



GNU_CLASSPATH_ROOT=`<JATO_ROOT>/tools/classpath-config`

GLIBJ=$GNU_CLASSPATH_ROOT/share/classpath/glibj.zip

BOOTCLASSPATH=<JATO_ROOT>/lib/classes.zip:$GLIBJ


then applying usual gdb command ,i.e.,



gdb --args <JATO_ROOT>/java \
-Dgnu.classpath.boot.library.path=:$GNU_CLASSPATH_ROOT/lib/classpath \
-Xbootclasspath:$BOOTCLASSPATH -cp <JATO_ROOT>/regression class_file_name_to_debug



will launch it in debug mode. You can additionally pass any other command line option ( -Xint , -Xtrace:jit ... ) also.

No comments: