eclipse 即时窗口

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2014068/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 14:17:01  来源:igfitidea点击:

immediate window

eclipseimmediate-window

提问by bugzy

Is there anyplace in the eclipse ide that I can enter immediate code while stoped at a breakpoint?

eclipse ide 中是否有任何地方可以在断点处停止时输入立即代码?

thanks

谢谢

回答by Chris Persichetti

It's called the Displaywindow in Eclipse. Menu Item: Window/Show View/Display

它在 Eclipse 中称为“显示”窗口。菜单项:窗口/显示视图/显示

To run command you need to type then select the text in the display window and select one of the two J icons in the window.

要运行命令,您需要键入然后在显示窗口中选择文本并选择窗口中的两个 J 图标之一。

回答by VonC

Note: as mentioned in Debugging with the Eclipse Platform, you can use the Display View to scrapbook your live code.

注意:如使用 Eclipse 平台调试 中所述,您可以使用显示视图来剪贴您的实时代码

Meaning, while you have a live debug session:

意思是,当您进行实时调试会话时:

live debug session

实时调试会话

, you can run/debug some expressions or code in a Display view:

,您可以在显示视图中运行/调试一些表达式或代码:

display view

显示视图

Example:

示例

Example

例子



See My favorite Eclipse view

查看我最喜欢的 Eclipse 视图

  • To execute the code and display the returned value, push the button with a "J":
  • If you just want to execute some code that doesn't return a value, push the button with an arrow ">" and a "J":
  • 要执行代码并显示返回值,请按下带有“ J”的按钮:
  • 如果您只想执行一些不返回值的代码,请按下带有箭头“ >”和“ J”的按钮:

The standard output will be printed to the Console view.

标准输出将打印到控制台视图。