I am currently trying to track method calls for learning purposes.
The javagent I have implemented is a modified version of the implementation in this article. The programm adds to any method call logging instructions into the bytecode. Unfortunately bootstrap classloader refuses to load any manipulated content from rt.jar. I can understand that this isn't a good idea for a production enviroment, but for a student it would be really amazing.
Do you got any ideas how to make this happen?
The only chance you have is to change the contents of rt.jar. The bootstrap class loader is special in many ways, many, but not all, of the classes are loaded before the agent even starts up.
Some classes can be explicitly redefined using the
redefine
method. This is however not possible for all bootstrap classes.