During the debuging, most of time i am forced to select a variable and right click display to see its value.
for exemple for this, it always works, but never for local variables? (or lets say most of time)
here its working (without right click display):
here its not !? :
Related
In my java eclipse debugger the variables field is always empty and the step over and step into icons are disabled help me with this issues
I did try all the options from google like adding checking variables attributes in preferences menu but am still unable to find a solution help me friends
This is a issue that is faced sometimes, somethings you might try out are:-
-> Close variable window and open again
-> Reset the perspective and see if variables now show up.
-> Close the variables tab and then reset the perspective, this should reopen the working variables tab.
-> If none of them still works , you can right click on the variable and select inspect, then it should come up in a popup window
Incase you do not know how to show vairables view, Window --> Show View --> Variables
Reference
In order to see the value of variables, you have to set a breakpoint.
See the documentation here: EclipseDebugging
If you already set it, try resetting the perspective
I am not sure if it is recent issue or it was from the "beginning". Is it normal behavior that we can't see the value of variable in debug mode when we tick on it? (It says ctr+shift+I to watch).
You can also use ctrl + shift + D to display the selected content.
Whatever you are trying to get the contents debug should reach that code.
No, this isn't normal behaviour in Eclipse. As soon as a thread hits a breakpoint and enables the debugging perspective, you should be able to inspect your variables either by hovering, Ctrl+Shift+I or with "Inspect" in your context menu.
In what state is Eclipse when you are trying to watch the variable?
I'm currently using Spring Tool Suite 2.9.2 (based off of Eclipse 3.x).
In every class that I debug through, it has no issue with on-hover displaying the values of my variables. But, when I am in an abstract class, on-hover just displays the variable type and name.
This is super frustrating to me, because the values get displayed in the Variables window. I usually go "Oh, I'm in an abstract class..." and I have to switch my perspective.
Is there anyway that I can display values on-hover in an abstract class with Eclipse?
I've tried resetting hover options to default and checking the combined hover button to no avail.
You can select the variable and do a Ctrl + Shift + I to inspect/view the value of that variable.
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 I have no idea how to do that for several variables.
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
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.
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.
And how about selecting the text you want to watch, and then using the shortcut "Ctrl + shift + I"
I'm debugging my code to see if the variable is receiving new values during execution.
How can I watch it and make it stops when the value is changed by something?
I've got a CheckList and set the selectedValues with some values, and for some reason, the values selected are disappearing.
Use the outline view (Window -> Show View -> Outline) to select your variable. Right-click it and select Toggle Watchpoint. It will create a breakpoint for your variable. Right-click this breakpoint, select properties and leave only the checkbox "Field modification" enabled.
I think that this cannot be done for variables declared inside methods, although you can use it for class or instance variables.
You could use a breakpoint with a condition for the value.
You could set a breakpoint on the setter method for the value.
If the debugger does appear to help. esp if the problem doesn't appear when you debug it. You can add logging which can show you where a change is made. e.g.
log.info("Changed "+changeDescription, new Throwable("HERE"));