Does eclipse have a way, while debugging, to find variable when I know only its value? Or are there any plugins for this? Thanks.
Sometimes I do not know where the variable is, but I know the value of the variable. If it is an object, I do not know all values or variables, but I know one value. So I would like to find this variable knowing its value.
Press Ctrl+Shift+d or Ctrl+Shift+i on a selected variable or expression to show its value. You can also add a permanent watch on an expression/variable that will then be shown in the Expressions view when debugging is on.
When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you the value of that variable. If the variable is an object, you can expand the object by clicking on the arrow to see the elements of that object.
You can not check local variable unless you are in the method. As local variables have scope of the block of the method, they will be inaccessible unless method is executing and thus you are getting "variable can not be resolved" message.
I have long needed this kind of thing for exploring third-party code at a breakpoint. This eclipse plugin, evars, seems to have potential, but I mostly end up with a very long-running search that results in an eclipse heap space error.
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