Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse "Set Next Statement"

Tags:

Is there a way to jump to a line of code in Eclipse for Java? It would be useful for re-running a function to debug. Something like Visual Studio's "Set Next Statement" or the draggable yellow arrow?

Yellow arrow in Visual Studio

like image 469
RunHolt Avatar asked Jan 13 '12 19:01

RunHolt


People also ask

How do you set a next statement?

Set Next Statement (shortcut: Ctrl + Shift + F10 ) is very useful feature and allows to move execution pointer to selected statement. This can be used to not execute statement(s), like skipping line 27 in above example.


2 Answers

When in the debugger select a place in the stack, right click, and select "Drop to Frame". This will unwind the call stack. You can do this on the current method (top of the call stack) to unwind to the top of the method. This doesn't work all the time for various reasons but you can do it pretty often.

like image 107
BenjaminLinus Avatar answered Oct 31 '22 07:10

BenjaminLinus


This feature does not exist even conceptually in the JVM Tools Interface, much less in the Java Debug Wire Protocol that IDEs tend to interface with. Implementing it in an IDE would require creating (and mantaining) a custom build of Hotspot/JRockit/etc itself.

like image 39
Sam Harwell Avatar answered Oct 31 '22 07:10

Sam Harwell