At the link below it explains that the \"display view allows you to manipulate live code in a scrapbook type fashion (see Figure 8). To manipulate a variable, simply type t
I think this powerful feature should be used way more often.
Window -> Show View -> (search for) Display
myObject.getSomeData();
, you can autocomplete (Ctrl+Space)Not sure why this view is not there by default, it should be !
As of Eclipse Photon Release (4.8.0)
This same functionality can be performed inside the the Debug Shell
. I do this by:
Debug Shell
Execute Selected Text
, or Display Result of Evaluating Selected Text
I'm including this answer because as of 2018, with the Photon Release, I was unable to get the Display view to work in any capacity or to even show up. But I was able to perform the same work through this method.
You can view the Display
view as a place where you can inspect all sorts of variables and boolean expressions during runtime. While your debugger is frozen on a breakpoint start typing the name of an object variable for instance and you'll get autocomplete functionality as you start calling methods or fields to reach deeper class datastructures. Then when you select/mark the portion you need to inspect or everything, the buttons on the Display view will be clickable. You can always perform the Ctrl+Shift+I
shortcut on the selection to view what's the current runtime state of your selection i.e. variable, object, boolean exrepssion etc
When you've stopped at a breakpoint, you can write or paste code into the Display view, select it, and press Ctrl+Shift+I to inspect (i.e. evaluate) the selection.
It will only work while running in debug, and you can only manipulate variables that are live in the context of the currrent thread, which means that you need to place a breakpoint at (or just after) the point where the variables you want to inspect become active. Whilst you hold on the breakpoint you can use the Display tab to interact (execute code snippets, evaluate etc..) with all the variables that you can see in the Variables tab