Re: Incorrect Parameter Order

Eliot Moss <[email protected]> Sat, 2 Dec 2017 08:52:22 -0500
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
On 12/2/2017 1:04 AM, ThanhVu (Vu) Nguyen wrote:
> Thanks for the javap tip.  I figured out the problem (I shouldn't use visietMethodInsn because that 
> will add the println to where I call trace,  instead of adding the println inside the trace function).

Glad that's helpful.

> Another question, assume my class has a method called "foo" and "trace".  Can I obtain Method 
> objects that represent these method ?  So that I can quickly get information about parameter, types 
> etc of the methods.

Not in the Java sense when you're running ASM, because at that point the class has not been loaded.
But in a ClassVisitor each method will be visited, and you will have its signature available at
that point (see visitMethod).

> @Eliot  I want to use ASM because I might not have the program src code as input,  just the class 
> file (compiled with debugging info).  Currently I am learning ASM so I just use some simple examples 
> that can be done by just parsing the src directly.

I was speaking not so much about the classes that have trace calls added to them as about the
tracing class itself, the one whose method bodies you were asking how to fill in automatically.
But if that was just a sample as to how to ASM, then I understand.

Regards - EM


-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws