During debugging in Eclipse, is it possible to jump to a line and execute it during debugging?

前端 未结 3 711
粉色の甜心
粉色の甜心 2021-02-05 12:49

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 debug

相关标签:
3条回答
  • 2021-02-05 13:20

    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.

    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.

    0 讨论(0)
  • 2021-02-05 13:40

    You can jump backwards, to the top of the function, using Eclipse's "drop to frame" feature. Right-click the function at top of the stack.

    You can't skip foo2(), but you could possibly edit variables to undo whatever effects it has had.

    0 讨论(0)
  • 2021-02-05 13:44

    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.

    0 讨论(0)
提交回复
热议问题