在Eclipse调试过程中,是否可以跳转到一行并在调试过程中执行它? [英] During debugging in Eclipse, is it possible to jump to a line and execute it during debugging?

查看:195
本文介绍了在Eclipse调试过程中,是否可以跳转到一行并在调试过程中执行它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio中,调试会话期间可能会跳转到光标选择的行并执行该行。跳到该行后,您可以继续从您跳过的行调试。这个功能是否存在于Java / Eclipse世界中?

In Visual Studio, it was possible during debugging sessions to jump to the line selected by the cursor and execute that line. After jumping to that line, you can continue debugging from the line that you've jumped to. Does this feature exist on the Java/Eclipse world?

例如:


foo1();

foo1();

foo2();

foo3();

return true;

return true;

在Visual Studio中可以打破foo1(),放置光标在foo3()上,执行foo3()而不执行foo2。此外,当调试器在返回true停止时,我可以将光标放在foo1上,再次执行foo1。此外,我可以通过这些操作继续执行任意代码行。

In Visual Studio it is possible to break on foo1(), place the cursor on foo3(), execute foo3() without executing foo2. Furthermore, when the debugger is stopped on "return true", I can place the cursor on foo1, and execute foo1 again. Furthermore, I can continue to execute arbitrary lines of code through these actions.

推荐答案

是的。放一个断点就行,按F8,等待程序执行直到这一行,然后按F6进入下一行,或者F5进入当前行。

Yes. Put a breakpoint on the line, hit F8, wait for the program to execute until this line, and press F6 to go to the next line, or F5 to step into the current line.

编辑:

线程在调试器中暂停之后,您还可以选择一些可运行的代码单击,然后选择显示(Ctll-Shift-D)或执行(Ctrl-U)。您也可以使用显示视图键入任何语句,选择它并执行或显示。

Once the thread is paused in the debugger, you may also select some runnable code, right-click, and choose "Display" (Ctll-Shift-D) or "Execute" (Ctrl-U). You may also use the Display view to type any statement, select it, and execute or display it.

这篇关于在Eclipse调试过程中,是否可以跳转到一行并在调试过程中执行它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆