Consider a situation when you are debugging your code. You have a var that is strictly greater than 1. should be greater than one under all conditions. Then you catch a div by zero exception at r=1.0/var line. It would be nice to set a recorder that saves the state a line before var becomes 0. Then roll back there and see what have happened.

Running the debugger in VM and saving state frequently is the best way I can think of. This solution is way too bulky.

Another nice feature would be a log of a sequence of executed lines. This would help a lot when dealing with inherited spaghetti code.

Is there an IDE plugin make periodic backups of the state of variables when debugging Java code?


Not an IDE with roll back but you might find the output of the Coverity static analysis tool useful in such cases as it will show that you have a potential divide by zero error and all of the decisions/steps that it took to get to that state. So if the divide by zero is happening on line 100 of module B it might tell you that you can get it happen if the function that line is in is called from A with a parameter of 3 then this if goes this way, etc.

Coverity can analyse Java, Java Script, C, C++ & C# and if you are working on an open source project there is Coverity Scan which is free.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.