Tue Jul 10 22:41:00 GMT 2001
Tom Tromey <firstname.lastname@example.org> writes:
> javap: look at jcf-dump in gcj.
> I don't know if Sun's java[hp] are extensible from Java. If they are
> then you'll be disappointed by jcf-dump and gcjh; they are written in
> (sometimes poor) C.
The goal of jcf-dump is write out all the information in a .class file,
in a way useful for implementors. So it has more detail and a
different format that the output freom javap. There is a --javap flag
whose goal is to produce the same output as javap - but we haven't
put much effort into that. I think it is mainly that someone has to
care enough and have the time to sit down and do it. It should be
an easy beginner project, and shouldn't take more than a couple of days.
Another problem with jcf-dump is that the disassembler part of it
uses macros in a way that may be hard to understand. A simple
switch statement might in retrospect have been better. The disassembler
in gnu.bytecode.CodeAttr (see http://www.gnu.org/software/kawa/api/gnu/bytecode/CodeAttr.html ) does a rough but simple binary search of the opcodes,
plus various tricks for a compact and fast disassembler.
If someone wants a javap replacement in Java, you can use
More information about the Java