12

How can I step back to a previous line when I'm debugging in IntelliJ?

I don't see anything in the debug menu or commands to do this.

user626528
  • 13,999
  • 30
  • 78
  • 146
genxgeek
  • 13,109
  • 38
  • 135
  • 217

3 Answers3

11

There's no backward debugging support in IDEA currently. Nevertheless (for Java) there is Drop Frame action and button on the debugger toolbar. It lets you go one frame up in the stack and re-enter the current method.

enter image description here

Peter Gromov
  • 17,615
  • 7
  • 49
  • 35
1

In 2020, JetBrains made the Jump to Line plugin which allows you to move the execution point to another line of code while debugging.

Screenshot: move execution point (screenshot from JetBrains Blog)

It supports IntelliJ IDEA 2020+ and works with Java and Kotlin.

Pang
  • 9,564
  • 146
  • 81
  • 122
0

The Chronon plugin, which is available for free with IntelliJ IDEA 13, can do this for you. It has limitations, though; chiefly, if your application runs outside of the IDE itself (like a Tomcat or Jetty server), the free version won't be usable with your setup.

Makoto
  • 104,088
  • 27
  • 192
  • 230
  • 1
    It looks like Chronon records runs and when you play back a run then you can "run backward". But that's not during live debugging. – Mark Apr 08 '17 at 13:20