Re: Transforming classes from an agent, as per the example in the asm-guide.pdf

Yao Qi <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
On Thu, Apr 22, 2010 at 7:55 PM, Stanislav Paskalev <[email protected]> wrote:
> Hello,
>
> I'm having an issue with this code and any help will be appreciated :)
>
> http://pastebin.com/c8Hpdbp4 - the transform(...) method
> http://pastebin.com/UqXLZ6xD - the class modifying adapter
> http://pastebin.com/145GzSzG - the method modifying adapter.
>
> Forgive the fantasy names, I can't seem to get it working after the
> transform() method. Calls to transforms do happen every time the jvm
> loads a class, however when it hits the first line of it during debug
> (with the class reader), it seems to completely leave this and instead
> gets at
>        TransformerManager.transform(ClassLoader, String, Class,
> ProtectionDomain, byte[]) line: 175
>        InstrumentationImpl.transform(ClassLoader, String, Class,
> ProtectionDomain, byte[], boolean) line: 365
>        Signal.dispatch(int) line: 189

What is it?  Call stack?  It might be good if you can paste full call
stack here.

>
> If I place a breakpoint at the second line of the transform method -
> it's never reached.
>
> The pdf suggested doing it this way, but something isn't right by me.

To be honest, I don't understand your problem.

>
> I'm loading my agent in a jvm running jboss and some j2ee-based custom
> applications.
>
> (also, as a side question - can I use asm to redefine classes from the
> java runtime ?)
Yes, you can do that.

http://lamp.epfl.ch/java/jdk1.6/docs/api/java/lang/instrument/package-summary.html

>
> Thanks for reading all of this!
>
> Regards,
> Stanislav Paskalev
>
>
> --
> 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
>
>



-- 
Yao Qi <qiyaoltc AT gmail DOT com>    GNU/Linux Developer
http://duewayqi.googlepages.com/
message-footer.txt (text/plain, 238 B)
-- 
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.