Bi-directional Debugger Using Snapshot Thinning for Backward Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional debuggers are limited to forward execution and cannot effectively trace errors backward in time, especially when dealing with object code, variable length instruction sets, and programs lacking source code access, making it difficult to identify and debug issues in complex software systems.
Innovation Solution
A method for bi-directional debugging that involves instrumenting machine code to handle non-deterministic events, recording and replaying program states, and using snapshot thinning to manage memory usage, allowing for stepping backward in a program's execution history and identifying arbitrary points in its execution.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If conventional debuggers use forward execution only, then the debugger operation is simple, but the ability to trace errors backward in time is lost
Solution Approach 1:
The patent implements bidirectional execution by allowing the debugger to step both forward and backward through program execution. The execution controller can receive instructions to execute program code in forward direction or backward direction, enabling the debugger to trace errors from crash points back to their origin while maintaining operational simplicity through a unified execution model.
2Device complexity
If backward execution is implemented without recording intermediate results, then the execution mechanism is simple, but the ability to return to previous states is lost
Solution Approach 1:
The patent implements preliminary action by recording intermediate program states at breakpoints during forward execution before backward tracing begins. The recording controller captures register values, memory state, and execution context at these predetermined points, enabling the system to return to previous states during backward execution without requiring continuous recording of all intermediate results.
3Difficulty of detecting and measuring
If all intermediate program states are recorded for backward execution, then the ability to trace errors backward is achieved, but memory usage increases significantly
Solution Approach 1:
The patent applies extraction by selectively recording only the necessary program states at breakpoints rather than recording all intermediate states continuously. The recording controller identifies and stores only the states at significant points (breakpoints) where execution pauses, extracting only the essential information needed for backward tracing while minimizing memory consumption.
Solution Approach 2:
The patent segments the continuous execution history into discrete states at breakpoints. Instead of recording a continuous stream of all intermediate states, the system divides execution into segments separated by breakpoints, recording only the states at these segmentation points. This reduces memory usage while maintaining the ability to trace errors backward through the segmented history.
4Difficulty of detecting and measuring
If source code is used for debugging, then the ability to understand program logic is improved, but the ability to debug object code without source access is lost
Solution Approach 1:
The patent uses copying by creating virtual copies of program states and execution contexts at breakpoints. The recording controller captures the complete state including register values, memory contents, and execution flow information, creating a copy of the program state that can be examined and replayed during backward execution. This allows debugging of object code without requiring source code, as the copied states provide sufficient information to trace and understand program execution.
Data Source
AI summary
The present invention relates to debugging of computer programs, and in particular to bi-directional debugging.A method of returning to a state in the history of execution of a computer program, said state comprising a set of values of one or more of registers of a processor on which the program is running, working memory space to which the program has access and operating system resources allocated to the program, the method comprising: identifying in machine code representing said program, instances of machine code instructions associated with substantially non-deterministic events; modifying said program machine code to execute a program instrumentation set of machine code instructions to handle said substantially non-deterministic events; executing said modified program machine code, storing a time series of said states during said executing; restoring a said stored state; and executing said modified program machine code forward in time starting at said restored state to return to said state in said program history of execution.


