Finding variable value in Eclipse Debug Perspective

4.5k views Asked by At

I am debugging a program, and once I step in an instruction, I get a list of variables in the Variables view, or if I hold the mouse on the variable, the its value is shown.

Now, I have an object that could possibly have many references to other objects, which, in turn, have their own attributes that contain other objects and so on. The search space could become very large. I would like to find where these values could be by searching the object attributes by value. Eclipse already searches these objects by attribute.

I tried EVars plugin, but it doesn't seem to be still compatible with Eclipse 4.4. Any other tools or recommendations on how to do it?

Thank you very much!

1

There are 1 answers

0
cisk On

While debugging you can use the "Display" window where you can write pieces of code and "execute" them with inspect (highlight the code -> right click -> inspect).

In that window you have access to all variables of the breakpoint's context. You could use some java 8 streams snippets to filter your objects.

https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fviews%2Fdisplay%2Fref-display_view.htm

https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-evaluating_expressions.htm