开发者

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 t开发者_如何学JAVAesting 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


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

view global/static/inherrited variables in eclipse debugger


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜