classpathx-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Classpathx-discuss] Re: Java tools


From: Per Bothner
Subject: [Classpathx-discuss] Re: Java tools
Date: 10 Jul 2001 22:44:13 -0700
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor)

Tom Tromey <address@hidden> 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
gnu.bytecode.dump
-- 
        --Per Bothner
address@hidden   http://www.bothner.com/per/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]