在eclipse中,在调试时,如何访问交互式顶层(a.ka.“显示控制台”)? [英] In eclipse, while debugging, how do I access the interactive-top-level (a.ka. the "display console")?
问题描述
在我使用的大多数编程语言中,调试时,当我打破断点时,我有能力执行任意代码(无论我在打破断点后输入到控制台)。
In most programming languages I've used, when debugging, when I hit a breakpoint, I have the ability to execute arbitrary code (whatever I type into the console after the breakpoint has been hit).
如何在Eclipse中执行此操作?默认情况下,调试模式是显示控制台,但没有交互式控制台(可以输入Java代码立即执行)
How do I do this in Eclipse? The debugging mode has, by default, a display console, but no interactive console (into which I can input Java code for immediate execution)
推荐答案
您可以使用显示视图执行粗糙的代码,通过以下方式访问:
You can use the Display view to execute abritary code, access it via:
window->显示视图 - >显示
window->Show View->Display
然后键入要执行的代码(您可以使用 CTRL + SPACE
自动完成)
then type the code you want to execute (you can use CTRL+SPACE
for autocomplete).
执行代码,然后选择:
CTRL + SHIFT + D
CTRL+SHIFT+D
应该根据您打破的断点执行代码。
That should execute the code based on the breakpoint you've hit.
alt text http://i39.tinypic.com/1z4jsd0.gif
这篇关于在eclipse中,在调试时,如何访问交互式顶层(a.ka.“显示控制台”)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!