Does NetBeans have something akin to "Set Next Statement/Instruction" when debugging in Java?
Asked
Active
Viewed 4,806 times
3 Answers
8
No, unfortunately. This is one feature from Visual Studio that I really miss, but you just deal with it...

Justin Ethier
- 131,333
- 52
- 229
- 284
-
NetBeans has "Step Over" and "Step Over Expression". Not sure what the difference is? – Zxion ee Mar 23 '10 at 21:05
-
I have not used "Step Over Expression" but it looks like the idea is that you can step through multiple expressions on the same line, whereas "Step Over" would just step over the entire line. They talk about it at http://wiki.netbeans.org/DebuggerImprovements – Justin Ethier Mar 23 '10 at 21:12
-
I think its possible, see my answer. Maybe I misunderstood the 'set next statement' concept. – Karussell Mar 26 '10 at 08:51
-
7Ugh, that's ridiculous. Set next statement is VERY handy in Studio. – Mike Caron Sep 18 '11 at 02:40
-
Eclipse doesn't have this feature either: http://stackoverflow.com/questions/4864917/is-it-possible-to-go-back-in-java-eclipse-debugger-like-dragging-the-arrow-in – Csaba Toth Aug 02 '13 at 00:49
-
Seems like the JVM doesn't have an API for this. Very sad. That's why none of the big debugger supports it: http://devnet.jetbrains.com/message/619422?tstart=0 – Csaba Toth Aug 02 '13 at 00:52
1
How does 'Set Next Statement/Instruction' work?
You could set the cursor or a breakpoint to a specific line and resume debugging until this point via F4 or F5. Would this help?
Otherwise the keyboard is your friend:
- F7 == 'go into'
- F8 == 'next line'
- F5 == 'resume'
- F4 == run to cursor
- etc see the Debug-Menu-entry

Karussell
- 17,085
- 16
- 97
- 197
-
1We can set the cursor to go to almost any line of code in the actual method. This way we can skip or repeat any line of code =) I love this feature in VS. – Akira Yamamoto May 09 '13 at 17:59
-
More specifically, when someone does set next statement, then you don't execute those instructions which are between the current position of the instruction pointer and the target position. This largely different than the run to cursor. This way you can debug various scenarios without recompile. – Csaba Toth Aug 02 '13 at 00:46
0
There is the "Continue At" option, which, although nowhere near as good as VS's "Set Next Statement" can be quite useful. Not sure if this is available in Java, but it is in C++.

Wad
- 1,454
- 1
- 16
- 33