Efficient Algorithms for Bidirectional Debugging
This paper discusses our research into algorithms for creating an effcient bidirectional debugger in which all traditional forward movement commands can be performed with equal ease in the reverse direction. We expect that adding these backwards movement capabilities to a debugger will greatly increase its efficacy as a programming tool.
The effciency of our methods arises from our use of event counters that are embedded into the program being debugged. These counters are used to precisely identify the desired target event on they as the target program executes. This is in contrast to traditional debuggers that may trap back to the debugger many times for some movements. For reverse movements we re-execute the program (possibly using two passes) to identify and stop at the desired earlier point. Our counter based techniques are essential for these reverse movements because they allow us to effciently execute through the millions of events encountered during re-execution.
Two other important components of this debugger are its I/O logging and checkpointing. We log and later replay the results of system calls to ensure deterministic reexecution, and we use checkpointing to bound the amount of re-execution used for reverse movements. Short movements generally appear instantaneous, and the time for longer movements is usually bounded within a small constant factor of the temporal distance moved back.
Bob Boothe. (2000). Efficient algorithms for bidirectional debugging. In Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementation (PLDI '00) (pp. 299-310). New York: Association for Computing Machinery. DOI:https://doi.org/10.1145/349299.349339