How can i log all method calls with it arguments, performed by JVM at runtime, and maybe there is a possiblity to change method arguments, do some stuff before method is called, without changing JVM code itself?
I already had run through
but i am a newbie in how JVM is constructed in it nitty-gritty details, and my main question - is this a right way to start with this code(the code of Dtrace)? Maybe you can give me an article to read?
And also - can i do the same things on ART or dalvik? (not only debuggable applications, with the help of JDWP).
And one more thing - JMVTI is too slow, it takes nearly 300µs on calling handler.
Edited:
links, i got:
https://code.google.com/p/droidbox/
http://mostly-about-java.blogspot.ru/2012/12/methodcallspy-building-own-method_3.html?m=1
Technically it is possible on JVM using own javaagent . Alternatively you can use AspectJ framework and its Load Time Weaver to simplify this process.
Check this article for sample and repository for some code: https://bitbucket.org/espinosa/methodcallspy0
Unfortunately Dalvik/ART doesn't support javaagent so this will work only on 'real' JVM, but not on android.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.