Hi guys, I'm using ModificationWatchpointEvent from JDI to analyse the object behaviors.
Now I catch a ModificationWatchpointEvent e for a int field of an object MaxNum( a simple self-defined class ), thus I know that the value of the field was modified. The question is, is there any appraoch to find out which local variable was used to define it?
Say, like this:
int A = 5;
int a = 0;
a = A;
In this context, variable A was used to value variable a. In ModificationWatchpointEvent , I only know that the new value of a is 5, but I'm not aware of which local variable is used to define it.
Is there any idea to find out which local variable is used? Thanks a lot.
No. There is no support from jvmti/jdi to watch modification of local variables.
I do not know if this is possible in jvm to support this. We have to look into it and if possible we will file an RFE for this.