Instrumentation not working for methods invoked through reflection [closed]
-
13-12-2019 - |
Question
I am tracing the execution of Java applications to perform dynamic analysis on the execution traces.
Everything is fine but when a method is called through reflection. I can see the invocation of Method.invoke
but after that my trace does not contain the instructions executed through reflection.
As soon as the program goes back to 'regular' execution the program get traced again normally.
The person who wrote the instrumentor used the ASM library.
Solution
I solved my issue. The problem was not related to the instrumentation but to the configuration of the tool which by the way is open source.
Instrumentation worked properly because it worked by modifying the byte-code of the methods. Have a look at the code of the project to see how instrumentation should be done.