2

Is it possible somehow do not "Next step" but "Next step in opposite order" while debugging. It means ask compiler/IDE to get back to program state that was in previous line? I'm too lazy to restart whole application in case when I missed something while debugging. Currently I'm interested in such feature in Java, Eclipse or Net-beans IDE, but also other programming languages are interesting.

vico
  • 17,051
  • 45
  • 159
  • 315
  • By the way, in Java it is fundamentally impossible to completely "roll back" the effects of an arbitrary line of code (how would you roll back a thread start?), so no IDEs will give you exactly what you describe in the question. For other languages I think you should ask a separate question (though the same reasoning will probably apply to a lot of them). – biziclop Sep 11 '15 at 10:42

2 Answers2

4

I don't know a functionality like this exists, as an alternative in Eclipse you can use the functionality "Drop to frame" enter image description here . This goes back to the beginning of the method which you are currently located in. It helps to understand what has been done so far. It unfortunetly does not undo what has been done when dropping to frame, so if you change non-local attributes these remain changed.

michaeak
  • 1,548
  • 1
  • 12
  • 23
  • But this works only in one method (last) range. What if I need go back to this method caller? – vico Sep 11 '15 at 11:11
  • Ok, found this too.. – vico Sep 11 '15 at 11:14
  • The question that has been linked to this one proposes a real forward/reverse debugger. – michaeak Sep 11 '15 at 11:17
  • @vico You can also jump back to other methods if you select a method that is listed in the stack (see the blue selection in the image) and using "drop to frame". Then it will go back to the beginning of this method. – michaeak Sep 11 '15 at 11:20
0

I have only experience in ECLIPSE and I could say that you could use this feature while debugging in Eclipse by simply selecting the execution line you want to be selecting the line in the Debug tab and then pressing the Drop To Frame button.

Blip
  • 3,061
  • 5
  • 22
  • 50