mdaabis
mdaabis

Reputation: 127

Expression view in debugger mode not showing values - Eclipse

I am using Eclipse debugger mode and for some reason, when I type an expression into the Expression view, no corresponding value shows up. Even when I type in the name of valid variables that are populated (I know they're valid and populated because the code is working as expected and I can see their value in the Variable view and when I hover over them, just not in the Expressions view). I have tried restarting Eclipse, refreshing/rebuilding projects and nothing seems to work. It was working absolutely fine earlier in the day and then suddenly stopped working mid debug without any changes in settings. Does anyone know why this has happened and how to fix it? (Just to clarify, I am not trying to view the expressions of anything like a lambda function which I know cannot be evaluated in Expression view).

Edit: I think it has something to do with the fact that when I am debugging, Eclipse now stops at breakpoint in a new instance of that class but with a hollowed out J for Java next to the file name. Normal file File with hollowed out J where breakpoints are stopping at

Upvotes: 1

Views: 1546

Answers (2)

mdaabis
mdaabis

Reputation: 127

Turns out that the issue was in fact related to the edit I made to the original question. The hollowed out J for the file icon meant that while debugging, I was using the file as a resource instead of an actual compiled file. This caused the problem and also meant that changes I made to the code did not reflect because they weren't compiled. To resolve this I ensured that the projects I was using had the right dependencies and versions of other projects that are being used then refreshed gradle and restarted the server. That ensured that the desired file is actually compiled and not just used as a resource file.

Upvotes: 1

Mehmet Bektaş
Mehmet Bektaş

Reputation: 181

You can use Debıg Shell panel to show value of variable.

You can open this panel with Perspectives -> Debug Shell

Note: On older versions of eclipse, the name of this panel was Display.

Upvotes: 0

Related Questions