How to add expressions?
Just select the expression in the Java editor while debugging and choose Watch option from the context menu. The expression will immediately appear in the Expressions view.
You can also right click in the Expressions view and choose Add Watch Expression... option.
How to edit expressions?
If you have already some expressions added you can easily edit them by right clicking on the expression and choosing Edit Watch Expression.
What is important is that you can put any expression in this view - not only the ones that are in the code - if you want to check some hypothetical value then you can do that!
The are also some other interesting options in the context menu:
- you can copy expressions to the clipboard
- you can remove expressions
- you can look for expressions
- you can enable/disable expressions
- you can reevaluate expressions
In the view's toolbar you will find options to:
- show type names - shows the type names of the evaluated expressions
- show logical structures - while browsing the evaluated value of the expression you can look at its logical structure. e.g. instead of looking into the internals of the Map object:
you can see the logical structure of the map:
- create new watch expression (the 3rd way to do this)
- remove/remove all expressions from the view
- change the layout
- show constants
- show static variables
- show qualified names
- show null array entries
- show references