Recipe 5.8 Watching Expressions and Variables

     

5.8.1 Problem

You need to watch the value of a variable or expression as your code executes.

5.8.2 Solution

Highlight the variable or expression while debugging, right-click it, and select Watch, or select Run Watch. The variable or expression, along with its value, will appear in the Expressions view from then on.

5.8.3 Discussion

You can see an example in Figure 5-15, where we added the value of the variable named loopIndex to the Expressions view. As you execute your code in the debugger, the current value of loopIndex always appears in the Expressions view, unless you right-click it in the Expressions view and select Remove.

Figure 5-15. Watching a variable's value
figs/ecb_0515.gif



Eclipse Cookbook
Inside XML (Inside (New Riders))
ISBN: 596007108
EAN: 2147483647
Year: 2006
Pages: 232
Authors: Steve Holzner

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net