Backwards Debugging via Execution State Snapshots

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improveerror location identificationVSAvoidtime between error occurrence and manifestation
Core Design Contradiction:
Measurement precisionVSLoss of time

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.

Inventive Principle:
Principle #13The other way round (Inversion)

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.

Inventive Principle:
Principle #10Preliminary action

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

Engineering Contradiction:
Improveprogram execution completionVSAvoidintermediate execution results
Core Design Contradiction:
ProductivityVSLoss of information

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #26Copying

3Adaptability or versatility

If the debugger modifies machine code to handle non-deterministic events, then backwards execution becomes possible, but the device complexity increases

Engineering Contradiction:
Improvebackwards execution capabilityVSAvoiddebugger system complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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.

Inventive Principle:
Principle #1Segmentation

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

Engineering Contradiction:
Improveprogram execution speedVSAvoidexecution tracing complexity
Core Design Contradiction:
SpeedVSDevice complexity

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS9268666B2System and method for debugging of computer programs
Publication Date: 2016.02.23 UNDO
  • US9268666B2 patent drawing
  • US9268666B2 patent drawing
  • US9268666B2 patent drawing

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.