There is a Display view as well that can do exactly what you want. Go to Window > Show view > Display
(or Other... if the Display view is not there. In the Display view, you can type any code you want during debug (content assist is available). The current objects and variables are also available to use. After you wrote your code, you have to highlight it, right click and select Execute
or hit CTRL-U
. You may play around with the other possible actions as well.
Besides that, you can also write in the source code during debug and evaluate it using Display as you mentioned, if you have the source for the class you are debugging.