java disassembler/assembler
Per Bothner
per@bothner.com
Tue Oct 25 18:07:00 GMT 2005
Daniel Reynaud wrote:
>> It would be nice to have an option to print methods, classesm
>> and signatures in external (Java) syntax, rather than as signatures
>> ok, I added that to my to-do list. What about the <clinit> method ?
Sun's javap prints:
static {};
> the disassembler prints the constant pool as Jasmin comments. It also
> prints the constant pool indexes as Jasmin comments and also "tries" to
> fetch their actual value in the constant pool.
>> You can have a look at the attached test.j file, it has been produced by
> the disassembler with the following command :
> dejasmin --warmode --printoffsets --nolabels test.class > test.j
Well, printing everything twice is not a good interface.
Instead of:
; 2: invokespecial 1 (java/lang/Object/<init> ()V)
and then later:
invokespecial java/lang/Object/<init>()V
it is better to just print the instructions once:
2: invokespecial #1=java/lang/Object/<init>()V
The assembler could just ignore the "#NNN=" prefix. It would
be nice to have an option where the the assembler would try to
use constant pool entry NNN if it is unused or matches the request,
or pick a different or new entry otherwise (and printing a warning).
But I don't that's a critical feature.
Note also you only want to print the constant pool and the constant
pool indexes, in a "verbose" mode - probably not by default.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
More information about the Java
mailing list