Watching variables contents in Eclipse IDE

后端 未结 4 440
梦如初夏
梦如初夏 2020-12-13 03:45

How can I watch the contents of several variables (for example, TreeSet\'s) simultaneously? I can watch contents of one TreeSet, clicking on it in \"Variables\" window, but

相关标签:
4条回答
  • 2020-12-13 03:52

    You can use Expressions windows: while debugging, menu window -> Show View -> Expressions, then it has place to type variables of which you need to see contents

    0 讨论(0)
  • 2020-12-13 03:52

    You can do so by these ways.

    Add watchpoint and while debugging you can see variable in debugger window perspective under variable tab. OR Add System.out.println("variable = " + variable); and see in console.

    0 讨论(0)
  • 2020-12-13 04:11

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

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

    0 讨论(0)
  • 2020-12-13 04:13

    This video does an excellent job of showing you how to set breakpoints and watch variables in the Eclipse Debugger. http://youtu.be/9gAjIQc4bPU

    0 讨论(0)
提交回复
热议问题