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
- android: requires previous sdk support even if min sdk version is higher?
- Eclipse web servers - What is the difference between locations?
- Getting Android SDK installation to find JDK dropped javaw.exe out of Eclipse
- Convert to .cap error- invalid AID 1.0 in Eclipse
- DBeaver Content Assist colors
- Cannot instantiate the type ADBDataSource using axis2
- ClassNotFoundException when running outside IDE
- Unable to update R.java file to add new object?
- JSF Eclipse Designer
- Eclipse-CDT index file that is included via gcc -include
- Unable to properly link external Java library in Eclipse
- SQLite3 doesn't show anything
- How can I make a JProgressBar fill up during a certain interval?
- Create Jmix project on Eclipse
- Eclipse Icons are really small on high resolution screen
- Stop Eclipse from autocompleting
- Remote control Eclipse on Ubuntu
- Deploy Java EE application as root context on WildFly
- How to Capture Exception in ADF JSFF
- phonegap won't install or work correctly
- RadioGroup is not saving preferences
- Way to demo Program written in IDE to project partner?
- Maven Failed to execute goal com.jayway.maven.plugins.android.generation2
- How to display sqlites file.db in eclipe as part of python 3
- PyDev content assist: 'The interpreter location found does not exist.'
- Export a jsprit maven project to an executable jar
- Invalid Configuration Location
- Flex - changes to mxml not reflected in browser
- Create Android apps in Eclipse sharing common library