When debugging a C/C++ application I can create a watch of an address cast to a pointer type and then view that contents of a structure even when it goes out of scope. Is it possible to achieve something like that in Java?
Let's say I'm in a method, I add a watch to something like "&this" and then when I leave the class method I can still see its contents even though it is out of scope?
I'm pretty sure the answer to my question is "no" so I'm mostly interested in "Why not?" explanation. Is this a JVM limitation? A JPDA limitation? Is there a better place to ask such a specialized question?
In C/C++ you are watching (the area pointed to by) an arbitrary pointer, casting to that variable.
In Java there are no pointers. You can only watch
a variable. Out of scope it does not exist.
Why would you want to watch it anyway? If you put a watch on it, it is watched properly when in scope.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With