view global/static/inherrited variables in eclipse debugger

14,066

Solution 1

You can use the Expression View to watch an arbitrary expression, including static and global variables.

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

Solution 2

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

Solution 3

In the Debug Perspective, open the Variables view, click on the downward pointing arrow at the top right of the pane and select Java / Show Static Variables

Share:
14,066
drew
Author by

drew

Updated on June 13, 2022

Comments

  • drew
    drew almost 2 years

    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

  • drew
    drew about 13 years
    thank you, that is exactly what I need. I feel kind of stupid that I wasn't able to find that on my own
  • no.good.at.coding
    no.good.at.coding about 13 years
    To tell you the truth I had to Google it also! Now we both know :)
  • FDIM
    FDIM over 10 years
    Long annoyance finally gone, thanks! Don't know why I didn't google for this before..