How to view a variable in real time while debugging on Eclipse?

I am trying to see a variable change in Eclipse debugging during my program. But I can only find how to look at a variable when I have a set of breakpoints set that pauses the program. I want to see the change of a variable in the eclipse window while I use the program, without pausing the program every time the variable changes.

Is there any way to do this?

+4
source share
2 answers

It is impossible to do this that I know of. The closest I could imagine was to have a stream that captures what you want to control and periodically prints its value. You may need to synchronize access to this object at this point, as multiple threads may touch it.

+1
source

For varX Add System.out.println ("varX =" + varX); and see in the console, or LogCat in the tag = System.out

PS You can see this answer on the link below, voted! "Programmers" hate a simple solution, and for this reason the question remains unanswered. View variable contents in the Eclipse IDE

+1
source

All Articles