View variable contents in the Eclipse IDE

How can I view the contents of several variables (e.g. TreeSet) at the same time? I can view the contents of one TreeSet by clicking on it in the Variables window, but I don’t know how to do this for several variables.

+62
java debugging eclipse
Apr 14 2018-11-11T00:
source share
4 answers

You can use the "Expressions" windows: during debugging, in the menu window β†’ "View" β†’ "Expressions", then it has a place to enter variables from which you need to see the contents

+85
May 6 '13 at 8:36
source share

You can add a watchpoint for each variable you are interested in.

A breakpoint is a special breakpoint that stops an application from executing whenever the value of a given expression changes, without specifying where this might occur. Unlike breakpoints (which depend on a particular line), watchpoints are associated with files. They take effect whenever the specified condition is true, regardless of when and where it occurred. You can set the watchpoint on a global variable by highlighting the variable in the editor or selecting it in the Structure view.

+18
Apr 14 2018-11-14T00:
source share

This video perfectly shows you how to set breakpoints and view variables in Eclipse Debugger. http://youtu.be/9gAjIQc4bPU

+3
Sep 19 '13 at 20:08 on
source share

You can do this in the following ways.

Add a watchpoint and during debugging you can see the variable in perspective of the debugging debugging window under the tab of variables. OR Add System.out.println("variable = " + variable); and see the console.

-one
Apr 14 2018-11-11T00:
source share



All Articles