Shadow Debugging of Optimized Binaries Using Guard Breakpoints

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Debugging optimized code is inefficient due to missing context information and the need for frequent recompilation, while non-optimized code is too slow for practical use, leading to suboptimal debugging experiences.

Innovation Solution

A method and system that maps an optimized binary to a non-optimized binary by generating a dependency graph, adding guard breakpoints, and redirecting execution between the two during debugging, allowing seamless navigation and context retrieval.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If non-optimized code is used for debugging, then context information is available and debugging is easy, but execution speed is too slow for practical use

Engineering Contradiction:
Improvedebugging easeVSAvoidexecution speed
Core Design Contradiction:
Ease of operationVSSpeed

Solution Approach 1:

The system segments the binary into optimized and non-optimized portions, allowing the optimized binary to execute at high speed while the non-optimized binary provides debugging context. The dependency graph divides the codebase into functions that need optimization versus those that need debugging support.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The dependency graph acts as an intermediary between the optimized binary and non-optimized binary, mapping functions and variables across both versions. This mediator enables the debugger to navigate between the performance-optimized code and the context-rich unoptimized code without requiring the entire system to run in one mode.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Speed

If optimized code is used for debugging, then execution speed is sufficient for practical use, but context information is missing and debugging becomes difficult

Engineering Contradiction:
Improveexecution speedVSAvoidcontext information
Core Design Contradiction:
SpeedVSLoss of information

Solution Approach 1:

The system maintains copies of both optimized and non-optimized binaries side by side. The non-optimized binary serves as a reference copy that preserves original context information, variable names, and debugging metadata, while the optimized binary provides performance execution. The dependency graph links corresponding functions between the two copies.

Inventive Principle:
Principle #26Copying

3Loss of information

If optimizations are disabled for specific functions to improve debugging, then context information is available, but rebuild time increases and productivity decreases

Engineering Contradiction:
Improvecontext informationVSAvoidrebuild time
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

The system performs preliminary action by pre-generating and maintaining both optimized and non-optimized binaries with a pre-computed dependency graph before debugging begins. This allows the debugger to immediately access both versions without requiring on-demand recompilation when context information is needed.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system changes the parameter of binary optimization status by maintaining multiple versions with different optimization levels. Instead of recompiling with different flags, the system switches between pre-built optimized and non-optimized binaries based on the debugging needs, avoiding the time cost of recompilation.

Inventive Principle:
Principle #35Parameter changes

4Loss of information

If the entire codebase is recompiled when optimizations need to be adjusted, then debugging context is improved, but time required for rebuild and restart increases

Engineering Contradiction:
Improvedebugging contextVSAvoiddebugging efficiency
Core Design Contradiction:
Loss of informationVSProductivity

Solution Approach 1:

The system applies local quality by selectively applying different optimization levels to different parts of the codebase. The dependency graph identifies which functions require debugging context versus which can remain optimized, allowing localized adjustments without recompiling the entire codebase.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS20250342104A1Systems and methods for shadow debugging an optimized binary with a corresponding non-optimized binary
Publication Date: 2025.11.06 MICROSOFT TECHNOLOGY LICENSING LLC
  • US20250342104A1 patent drawing
  • US20250342104A1 patent drawing
  • US20250342104A1 patent drawing

AI summary

Systems, methods, and devices are provided for shadow debugging an optimized binary with a corresponding non-optimized binary. Embodiments compile a binary into an optimized binary and generate a dependency graph. The dependency graph associates functions within the binary. Embodiments further identify a breakpoint within the optimized binary and add a set of guard breakpoints in the optimized binary based on the breakpoint and the dependency graph. The guard breakpoints reference a portion of a non-optimized binary. Embodiments redirect to the portion of the non-optimized binary from the optimized binary.