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?
在Visual Studio中,可以在调试会话期间跳转到游标选中的行并执行该行。在跳转到该线之后,您可以继续从跳转到的该线进行调试。这个特性是否存在于Java/Eclipse世界?
For example:
例如:
foo1();
foo1();
foo2();
foo2();
foo3();
foo3();
return true;
返回true;
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.
在Visual Studio中,可以中断foo1(),将光标放在foo3()上,执行foo3(),而不执行foo2。此外,当调试器在“return true”上停止时,我可以将光标放在foo1上,并再次执行foo1。此外,我可以通过这些操作继续执行任意的代码行。
2 个解决方案
#1
1
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.
是的。在线上放置断点,点击F8,等待程序执行到这条线,然后按F6进入下一行,或者按F5进入当前行。
EDIT:
编辑:
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.
在调试器中暂停线程之后,您还可以选择一些可运行的代码,右键单击,然后选择“Display”(Ctll-Shift-D)或“Execute”(Ctrl-U)。您还可以使用Display视图键入任何语句、选择语句、执行或显示语句。
#2
8
Click on the line you want to run to and press Ctrl+R and it will run to that line instead of putting in tons of break points. Also you can use F8 to run to your next break point or F6 to run to the next line.
单击要运行到的行并按Ctrl+R,它将运行到该行,而不是输入大量的断点。还可以使用F8运行到下一个断点,或使用F6运行到下一行。
#1
1
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.
是的。在线上放置断点,点击F8,等待程序执行到这条线,然后按F6进入下一行,或者按F5进入当前行。
EDIT:
编辑:
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.
在调试器中暂停线程之后,您还可以选择一些可运行的代码,右键单击,然后选择“Display”(Ctll-Shift-D)或“Execute”(Ctrl-U)。您还可以使用Display视图键入任何语句、选择语句、执行或显示语句。
#2
8
Click on the line you want to run to and press Ctrl+R and it will run to that line instead of putting in tons of break points. Also you can use F8 to run to your next break point or F6 to run to the next line.
单击要运行到的行并按Ctrl+R,它将运行到该行,而不是输入大量的断点。还可以使用F8运行到下一个断点,或使用F6运行到下一行。