Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

debugging - How to step back in Eclipse debugger?

Is it possible to do reverse execution in Eclipse debugger? The current project I'm working on requires a minimum of 5 seconds to read and initialize data from a file before anything can be done. If I overstep in the debugger, I have to terminate the program and restart, and this takes a fair bit of time.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...