Trace Replay Execution Control with Cross-Level Mapping

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional debugging methods face challenges in accurately controlling the execution of a program based on a low-level execution trace, particularly in production environments where pausing the debuggee can be detrimental, and existing trace-based debugging techniques lack the high-level execution control and accuracy needed for efficient bug identification and mitigation.

Innovation Solution

The implementation of a trace replay execution control system that uses a processor, memory, and recorded traces to correlate source code with native code instructions, allowing for precise execution control through breakpoint settings and alignment of trace data with source code statements, enabling forward and reverse execution replay without an executing runtime.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If live process debugging is used to examine state information and control execution, then debugging accuracy is improved, but service agreement violations and system harm occur due to pausing production software

Engineering Contradiction:
Improvedebugging accuracyVSAvoidservice agreement violation
Core Design Contradiction:
Measurement precisionVSObject-affected harmful factors

Solution Approach 1:

The system performs preliminary actions by recording execution traces and state information during normal production operation before debugging is needed. This allows developers to later examine and control execution based on pre-recorded data without pausing the live system, thus maintaining debugging accuracy while avoiding service agreement violations.

Inventive Principle:
Principle #10Preliminary action

2Productivity

If execution traces are recorded for later analysis, then system uptime is improved, but trace data alignment with source code becomes inaccurate due to low-level recording

Engineering Contradiction:
Improvesystem uptimeVSAvoidtrace data alignment accuracy
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The system introduces an intermediary layer that records both low-level execution traces and corresponding high-level source code information simultaneously. This intermediary recording mechanism maintains accurate mappings between trace data and source code statements, enabling precise debugging analysis while keeping the system running without pauses.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If low-level execution traces are used for debugging replay, then system performance is improved, but execution control accuracy deteriorates due to lack of high-level information

Engineering Contradiction:
Improvesystem performanceVSAvoidexecution control accuracy
Core Design Contradiction:
ProductivityVSEase of operation

Solution Approach 1:

The system merges low-level execution traces with high-level source code information into a unified debugging data structure. This combination preserves the performance benefits of low-level tracing while incorporating high-level contextual information that enables accurate execution control operations during replay, making the system both fast and easy to control.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentEP3788490B1Execution control with cross-level trace mapping
Publication Date: 2023.06.28 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP3788490B1 patent drawingFigure 1~3
  • EP3788490B1 patent drawingFigure 4
  • EP3788490B1 patent drawingFigure 5~7

AI summary

Described technologies aid execution control during replays of traced program behavior. Cross-level mapping correlates source code, an intermediate representation, and native instructions in a trace. The trace includes a record of native code instructions which were executed by a runtime-managed program. The trace does not include any executing instance of the runtime. Breakpoints are set to align trace locations with source code expressions or statements, and to skip over garbage collection and other code unlikely to interest a developer. A live debugging environment is adapted to support trace-based reverse execution. An execution controller in a debugger or other tool may utilize breakpoint ranges, cross-level mappings, backward step-out support, and other items to control a replay execution of the trace. Aspects of familiar compilers or familiar runtimes may be re-purposed for innovative execution control which replays previously generated native code, as opposed to their established purpose of generating native code.