Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

view global/static/inherrited variables in eclipse debugger

This is a minor annoyance for me that keeps coming up. When I'm debugging a program I can see variables in the immediate scope, but I can't see variables which are global, static, or variables inherited by 'this' class. The only way I know how to get these values for testing is to create a dummy variable to store the variable I want within scope of a given function, which isn't efficient or elegant.

Is there an easier way to see the value of any/all of the three variable types I mentioned while stepping through the debugger?

Thanks

like image 859
drew Avatar asked Apr 14 '11 14:04

drew


People also ask

How do I show static variables in Eclipse debugger?

Variables. We can see the values of variables during the execution under the Variables view. In order to see the static variables, we can select the drop-down option Java -> Show Static Variables. Using the variables view, it's possible to change any value to the desired value during the execution.

How do I view global variables in Visual Studio?

You can go to the quick-watch window - Ctrl + Alt + Q , enter the variable name there, and press Add Watch . The variable will be added to the Watch window. Save this answer. Show activity on this post.

How do you evaluate while debugging in Eclipse?

Alternatively, do Ctrl + Shift + I after selecting the expression. If you want to continuously evaluate an expression, say because it is within in a loop, you can watch it in the Expressions view.


1 Answers

Expanding the entry for this in the Variables view in the Debug Perspective should let you view all of those (non-static) members already, by default.

To view constants and static members, in the Variables view's menu (opened by clicking the little down arrow at the top right of the view), choose Java > Show Static Variables or Show Constants

Show Static Variables

like image 159
no.good.at.coding Avatar answered Nov 15 '22 20:11

no.good.at.coding