A historical debugger is able to revert program state (including current instruction) to a former state. How is this possible in managed or unmanaged environments? I can't imagine that the debugger takes a state shot of the whole system on every instruction.
A debugger is a software tool that can help the software development process by identifying coding errors at various stages of the operating system or application development. Some debuggers will analyze a test run to see what lines of code were not executed.
Definition: Debugging is the process of detecting and removing of existing and potential errors (also called as 'bugs') in a software code that can cause it to behave unexpectedly or crash. To prevent incorrect operation of a software or system, debugging is used to find and resolve bugs or defects.
Debugging means to run your code step by step in a debugging tool like Visual Studio, to find the exact point where you made a programming mistake. You then understand what corrections you need to make in your code and debugging tools often allow you to make temporary changes so you can continue running the program.
The terms "bug" and "debugging" are popularly attributed to Admiral Grace Hopper in the 1940s. While she was working on a Mark II computer at Harvard University, her associates discovered a moth stuck in a relay and thereby impeding operation, whereupon she remarked that they were "debugging" the system.
One way to do this is to record the sources of non-determinism in the system (I/O, interrupts) and take state snapshots at various intervals. This way, you can "rewind" by restoring to a previous snapshot and playing forward using the recorded non-determinism until you hit your desired point in the past.
For example, imagine this timeline:
1 2 3 4
| | | |
Suppose the user wants to rewind to point 3. You can do that by restoring the system state (e.g. memory, registers) to point 2 and letting the system execute as usual until it hits point 3. When data is needed from disk, the network, or some other non-deterministic source, the historical debugger can use its recorded information to provide the data. To the user, it appears that the state of the program was simply restored to point 3.
I believe this is a simplified view of how VMWare's Replay Debugger works (see also the tech talk).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With