Immediate Window for Eclipse
Asked Answered
P

3

92

Does Eclipse have an analog to Visual Studio's "Immediate Window", a window where I can evaluate statements while in the debugger?

Porphyrin answered 10/7, 2009 at 21:36 Comment(1)
Please accept Todd's answer as the accepted answer, AdamC's is useful but is more analogous to the Watch Window, whereas Todd has found the actual analog to the Immediate windowBename
B
65

Eclipse has a really cool concept call Scrapbook Pages where you can evaluate statements even when you're not debugging. However, if you want to eval code using values from the current program, go to Window->Show View->Expressions. There you can put in any expression you want and track it as your program executes.

Bangle answered 10/7, 2009 at 21:52 Comment(6)
Expressions are pretty close. Thanks!Porphyrin
while the answer is correct, in some way, Todds answer is better, as he provied a more exact analogy for VS Immediate WindowBrittne
auto-completion doesn't seem to work in the expression window. it's not convenient for evaluating snippets while debugging.D
Neat, I didn't know about Scrapbook Pages.Seismo
Expression does not work exactly like immediate window in Visual Studio, Todd's answer is much better and should be taken as answer.Salba
I think I should downvote this answer in favor of the next one about the Display windowKistler
M
136

Yes. The view name is "Display".

Window->Show View->Other It is under the Debug folder.

Once in there you evaluate statements while in the debugger.

Methylamine answered 10/7, 2009 at 22:0 Comment(6)
i would recommend updating this as the correct answer as it is much closer to the immediate window than the "expressions view".Cryostat
Thanks for that - I was missing the immediate window!Neelon
Select the statement, right-click and then Execute. You can also press the little play button on the display toolbar.Individualist
another option to open it Ctrl+Num 3 , then type expressionShot
Do function calls work in the display window? They don't seem to work for me, or maybe I am misunderstanding how they work. If I enter a function name and hit enter, it doesn't display the return value.Haden
In eclipse 2019-09 R, it is called Debug ShellDrub
B
65

Eclipse has a really cool concept call Scrapbook Pages where you can evaluate statements even when you're not debugging. However, if you want to eval code using values from the current program, go to Window->Show View->Expressions. There you can put in any expression you want and track it as your program executes.

Bangle answered 10/7, 2009 at 21:52 Comment(6)
Expressions are pretty close. Thanks!Porphyrin
while the answer is correct, in some way, Todds answer is better, as he provied a more exact analogy for VS Immediate WindowBrittne
auto-completion doesn't seem to work in the expression window. it's not convenient for evaluating snippets while debugging.D
Neat, I didn't know about Scrapbook Pages.Seismo
Expression does not work exactly like immediate window in Visual Studio, Todd's answer is much better and should be taken as answer.Salba
I think I should downvote this answer in favor of the next one about the Display windowKistler
M
5

Inspect ctrl-shift-i or Display ctrl-shift-d?

Morganne answered 10/7, 2009 at 21:37 Comment(1)
To clarify, you can highlight some code within the debugger and hit ctrl+shift+i or right-click->inspect to see the evaluation of the codeShir

© 2022 - 2024 — McMap. All rights reserved.