This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: java disassembler/assembler


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]