[kaffe] Re: Decoding compiled class files

Tony Wyatt wyattaw at optushome.com.au
Tue May 13 07:24:01 PDT 2003


Hi Dalibor,

On 13-May-03, you wrote:

>> Is there a utility around that would read my compiled classfiles and tell
>> me their contents? I'm now at the stage of trying to find out why the
>> jitters don't produce the right code on the m68k Amiga platform.
>> Comparing the class file from the interpreter with that from the jitters,
>> I find consistent differences, but I really need to know the contents of
>> the whole compiled class.
>> 
>> If there isn't anything available, I shall have to write one.
> 
> If you're talking about a java bytecode disassembler, there are many such
> tools. Kaffe has its own (from kopi), it's called javap. It disassembles
> class files to *.ksm files, in the kopi bytecode assembler syntax.
> 
No, that's not what I want. javap merely prints out the declarations of the
class and methods, no decode of the file contents.

kopi I can't get to run at all.

I want something that decodes and prints out the entire contents of the
.class file structure, so that I can see the variables, constants pool, 
initialisation, operations performed by bytecode, etc, etc. 
I'm trying to identify and then fix the difference of a single byte 
between two very simple files.

My source is:

< . . .>
double x = Double.NaN;
double y = Double.longBitsToDouble(0x7ff000abacab0000L);
double z = Double.longBitsToDouble(0x8000000000000000L);

System.out.println("x =" + x);
System.out.println("y =" + y);
System.out.println("z =" + z);
<. . .>
(expected outputs: Nan, NaN, -0.0)

tony





More information about the kaffe mailing list