Backwards Debugging via Execution State Snapshots
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional debuggers are unable to perform backwards debugging, making it difficult to trace errors in computer programs due to non-deterministic events and the loss of intermediate results during program execution, especially when debugging programs without access to source code or when errors occur in library routines or the compiler.
Innovation Solution
A method that involves modifying machine code to handle non-deterministic events, recording and replaying program states, and using snapshot and replay techniques to step backwards in a program's execution history, allowing for debugging by identifying and restoring specific states in a program's execution history.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If conventional debuggers use forward execution with breakpoints, then the program can be executed and errors can be caught at breakpoint locations, but the cause of errors occurring long before the error manifests itself cannot be identified
Solution Approach 1:
The patent implements bidirectional debugging by allowing the debugger to execute the program both forwards and backwards. The backwards execution capability enables tracing error causes by rewinding through program history, directly addressing the limitation of conventional forward-only debuggers that cannot identify errors occurring long before manifestation.
Solution Approach 2:
The system performs preliminary recording of program execution states (snapshots) at various points during forward execution. These recorded states enable subsequent backwards execution to replay the program history, allowing identification of error causes before the error manifests in the current execution context.
2Productivity
If the program executes forward with non-deterministic events, then the program can complete execution, but intermediate results are lost and cannot be retrieved for debugging
Solution Approach 1:
The system performs preliminary recording of program execution states (snapshots) at various points during forward execution. These recorded states enable subsequent backwards execution to replay the program history, allowing identification of error causes before the error manifests in the current execution context.
Solution Approach 2:
The patent creates copies of program execution states through snapshots and execution records. These copies preserve intermediate results that would otherwise be lost during forward execution, enabling the debugger to retrieve and examine previous states without interfering with the original program execution.
3Adaptability or versatility
If the debugger modifies machine code to handle non-deterministic events, then backwards execution becomes possible, but the device complexity increases
Solution Approach 1:
The patent introduces intermediary structures including execution records, snapshots, and a history management system that mediate between the original program execution and the backwards debugging process. These intermediaries enable bidirectional execution without requiring fundamental changes to the program's machine code or execution model.
Solution Approach 2:
The debugging system is segmented into distinct functional components: forward execution mode, backwards execution mode, snapshot management, and non-deterministic event handling. This segmentation allows each component to be developed and optimized independently, reducing overall system complexity while maintaining versatility.
4Speed
If the program uses jump instructions for control flow, then the program can execute efficiently, but it becomes impossible to trace execution backwards without keeping a record of program execution
Solution Approach 1:
The system performs preliminary recording of program execution states (snapshots) at various points during forward execution. These recorded states enable subsequent backwards execution to replay the program history, allowing identification of error causes before the error manifests in the current execution context.
Solution Approach 2:
The patent creates copies of program execution states through snapshots and execution records. These copies preserve intermediate results that would otherwise be lost during forward execution, enabling the debugger to retrieve and examine previous states without interfering with the original program execution.
Data Source
AI summary
We describe techniques which relate to bi-directional, in particular backwards, debugging of computer programs. Thus we describe identifying processes with shared memory access, such as threads or multicore processes, by arranging process (thread) memory ownership to deliberate provoke memory page faults to identify and handle concurrent memory access by multiple threads in such a manner as to enable deterministic replay, and hence backwards debugging.


