Open fjf2002 opened 1 month ago
Edit function while debugging: This goal is very difficult to achieve because the compiler currently always builds entire executables and is not able to identify individual program changes and incorporate them into an existing executable. For me it's a miracle that other systems (e.g. Java hot swap) can do this at runtime.
Move instruction pointer backwards If this is limited to the current method we could make snapshots of the uppermost stackframe in single step mode to rollback changes of local variables/method parameters. It's also possible to make snapshots of all fields of the current object. All data structures beyond that are nearly impossible to rollback.
What about changing variables in the debugger? Quite many IDEs can do that.
Changing variables in the debugger -> Good idea! I have implemented this now. Please check it out!
At work I am currently dealing with good old VBA. The VBA IDE can do some things other, more modern IDEs can't, when debugging.
For example, edit the function while debugging it. At least within some limits. Or move the instruction pointer backwards. At least within the current stack frame.
The user must do this responsibly. Think of side effects like setting variables or something like
file.readNextLine()
.But in principal, when a statement fails, often it is very satisfying to be able to edit the code, move the instruction pointer and continue execution.
How about that? (Can the online-ide already do things in that direction?)