View global / static / inherited variables in eclipse debugger

This is a minor annoyance for me, which continues to rise. When I debug a program, I see variables in the immediate area, but I do not see variables that are global, static, or variables inherited from the 'this' class. The only way I know how to get these values ​​for testing is to create a dummy variable to hold the variable I want as part of this function, which is inefficient or elegant.

Is there an easier way to see the value of all / all three types of variables that I mentioned when going through the debugger?

thanks

+6
source share
3 answers

You can use Expression View to view arbitrary expressions, including static and global variables.

Another convenient view is the Displays View , which allows you to execute arbitrary code.

+6
source

The record extension for this in the Variables view in Debug Perspective should allow you to view all of these (non-static) elements by default.

To view constants and static elements in the Variables view menu (opened by clicking the small down arrow in the upper right corner of the window), select Java > Show Static Variables or Show Constants

Show Static Variables

+15
source

In the Debug window, open the Variables view, click the down arrow in the upper right corner of the panel and select "Java / Show Static Variables"

+1
source

Source: https://habr.com/ru/post/885913/