You can use Eclipse's drop to frame command to re-enter the current method from the top. But it won't unroll any state changes that have happened, so it may not work depending on the sort of method you're in.
Another really cool tool that actually does let you step back and forward in time is the Omniscient Debugger. It works by instrumenting classes as they're loaded in the classloader, so it can record everything that your code does. It can do very cool things, like answer "when, where, and why was this field assigned its current value?". The UI is rather clunky, and it can have a hard time handling large code bases, but for some cases it can really save a lot of time.
Update: Chronon provides a commercial product that it describes as a "DVR for Java", which appears to do a lot of the same things as the ODB.
The question doesn't specify an Eclipse language, and many of the answers assume Java.
If using C++ and GCC with the GDB debugger, Eclipse has
Run->Move to Line which does the job and functions like the Visual Studio Set Next Statement. In this case, Eclipse is using the capability that is in GDB.
If using Java, I'm not aware of a way to it with Eclipse or Netbeans, although other answers have suggested plugins. Eclipse does have the "drop to frame" command which works for Java in my version (Juno SR1). If I modify and save code within a function in debug mode, the execution line automatically moves to the top of the current function and I can continue from there. Not the same as specifying the line, but it is something.
I was looking for this feature in eclipse too. I know the visual studio can do that. Actually you can drag the current line marker and drop anywhere back in code. I'm not pretty sure if the changes to variables can be undone. But it is still very useful even so and saves lots of time. I've been waiting for this in eclipse for a very long.
I am biased, but Chronon does exactly what you are looking for.
Drop to Frame isnt exactly stepping back, since if the method has changed anything on the heap it wont be reverted.
Yes, Eclipse CDT has support of historical debugger feature.
Open Debug Configuration -> Debugger -> Enable Reverse Debugging
at startup .
Than you can press
shift+F6 for step back like
F6 for step forward.
Beyond what's been mentioned in earlier answers - i.e. Eclipse's drop to frame feature in the debug view, which restarts debugging earlier in the stack frame (but does not revert global/static data) and Omniscient debugger, which is a bit raw and not so much evolving - there are a few Eclipse-based tools that could be used to "go back" in (run)time:
- JIVE: Java Interactive Visualization Environment
- Chronon: A “flight data recorder” for Java programs
- Diver (discontinued): Dynamic Interactive Views For Reverse Engineering
- Halik: Only for IntelliJ for now, but porting to Eclipse is mentioned on the roadmap.
JIVE extends Eclipse Java debugger with the ability to record the program states. The JIVE perspective provides some useful UML diagrams that are updated while the program is running. These diagrams provide an overview of the state of the application (object diagram) and of the stack trace (sequence diagram). You can query the memorized trace and step back and forward in time and see the corresponding diagrams.
Diver only records method calls and does not really record program states like JIVE. Every method call event is stored for later retrieval and analysis. It extends the Java Run and Debug configurations mainly to specify filters. Trace can be paused/resumed/filtered at runtime. Once recorded, the Diver perspective can display it in an interactive sequence diagram.
JIVE and Diver are open source projects issued from academic research. As of November 2012 both projects are active.
Chronon is a commercial product, but they have free licenses for students and open source projects. From what's being claimed on their website it's probably the most comprehensive recorder since it's able to replay the recorded history, step back and forth, allowing as they say time traveling debugging. Also Eclipse isn't needed for recording.
All of these plugin are quite greedy in resources so it's best to have a good spec machine and use their filter feature. A definite requirement to run them successfully is to extend the heap space in eclipse.ini.
In my case I've tried to use JIVE and Diver to debug an XML parsing program but always ended up freezing eclipse due to lack of resources. Diver could be tricky to run on linux 64bit, it works on ubuntu 32bit and possibly other 32bit distros using these tips. Diver works on Windows, better yet on a Windows 64bit + 64bit JVM otherwise you will be limited to a maximum heap space of 1.3-1.6Gb on 32bit windows. JIVE works great on my linux 64bit, and seems to work fine on other platforms.
- How to step back in Eclipse debugger?
- Eclipse IDE view gone - how to get it back
- How do I use the Eclipse debugger in an AsyncTask when developing for Android?
- How to install Eclipse + PHP Development Tools (PDT) + Debugger on Mac in The Year 2011
- How to arrange windows in Eclipse back into default state?
- How do I get the old colors and look & feel back in Eclipse 4.2?
- How to get the graphical layout Window back in Eclipse for Android Application Design?
- How to get back a file that was excluded from a build configuration in Eclipse CDT?
- How to get back a deleted project in eclipse
- How do I get the "referenced libraries" folder back In the eclipse sdk?
- Does eclipse have a debugger "step into selected" option that prompts for the method to step into?
- How to have Eclipse Remote Debugger keep listening on port until a JVM finally connects?
- How do you decompile, edit in eclipse and recompile an apk? Step by Step?
- How do you join back the split editor panes in eclipse
- How to bring back old style window docking in Eclipse Juno?
- Eclipse Debugger - how to display suspended threads only
- Step Back debugging in Eclipse
- How to install GDB debugger to Eclipse CDT
- How can I make the Eclipse Python debugger more reliable?
- How can I keep the Eclipse debugger from automatically expanding the Package Explorer into libraries on exceptions?
- Step to cursor/line eclipse debugger
- How to track value of a variable in Eclipse Java Debugger
- How to see the crash reason in Eclipse debugger
- Samsung Remote Test Lab (RTL) : how to bind the device to Eclipse / debugger
- How to step over method call in Eclipse Debugger?
- Eclipse - How do I view java arrays / collections better in debugger
- How do I change the default Eclipse Oxygen compiler compliance level from 9 to 1.8 and not have it revert back to 9?
- How to go back to unchecked 'Always run in background' progress in Eclipse IDE?
- How to get close button/icon back in Eclipse views
- How to get eclipse debugger to skip $$EnhancerByCGLIB$$ methods?
More Query from same tag
- Re-building a deleted class file in Eclipse
- How to get the Glue code/Step definition file generated automatically in cucumber?
- Mars Eclipse is sticking to a non-existing version of Java. How can I change it?
- Install SVN connector offline
- Eclipse with Android layout's main.xml?
- Can't Open Eclipse "No Java virtual machine was found"
- Javadoc in Eclipse failing to recognize packages
- Eclipse: How remove trailing white spaces on all lines for a non Java file?
- Android how to install older API versions?
- Export a project referenced as a library on a web project to tomcat
- Is the scala eclipse IDE stable enough?
- eclipse: Ant property not accessable when running in separate JRE
- Android Studio vs Eclipse IDE
- Servlet Error 404 - The requested resource [/ECommerce/Auth] is not available
- Separating EditText and TableRows in Layout
- Android/Eclipse Question - "id cannot be resolved or is not a field" error
- Is there a way to create an Object from a .class-file with missing source code?
- Why isn't my program that converts decimal to binary printing correctly?
- Subclass activity from a jar getting ClassNotFoundException
- GSON installation
- Canonical get active file code throwing FileNotFound exception
- How can I add Buttons in Preference Page which extends FieldEditorPreferencePage
- How to detect 3 key presses in SWT KeyListener
- Eclipse not starting after migration to new mac
- Problem building a Java Rules app in Eclipse
- Search through directories for specific Excel files and compare data from these files with inputvalues
- Choosing the correct JRE version in Gradle with Eclipse
- Unable to create a ToggleButton in Eclipse IDE for android
- File Search has encountered a problem in Eclipse
- How do I make a link to a line # with Eclipse?