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.
links, i got:
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.