Edit-and-Continue Debugging for Optimized Native Code via Segmentation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Enabling Edit-and-Continue functionality for optimized native code is challenging due to difficulties in correlating optimized machine code instructions with source code, leading to poor user experience and inefficient debugging, especially in gaming applications where optimized builds are common.

Innovation Solution

A method that allows developers to mark specific portions of source code to disable compilation optimizations, enabling incremental compilation and allowing Edit-and-Continue debugging by recompiling only affected parts, while maintaining optimized execution for the rest of the code.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If compilation optimizations are enabled for native code, then execution performance is improved, but debugging capability deteriorates

Engineering Contradiction:
Improveexecution performanceVSAvoiddebugging capability
Core Design Contradiction:
SpeedVSEase of operation

Solution Approach 1:

The patent segments the codebase into optimized and non-optimized portions, allowing different compilation strategies for different segments. Developers can mark specific functions or code regions with pragmas to exclude them from optimizations, enabling debugging in those segments while maintaining performance in others.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies local quality by allowing optimization settings to vary at the function or code region level rather than globally. Through the use of compiler pragmas and markers, specific local regions can be configured for debugging while the rest of the codebase maintains full optimization.

Inventive Principle:
Principle #3Local quality

2Measurement precision

If full code recompilation is performed to enable debugging, then debugging accuracy is improved, but build time increases

Engineering Contradiction:
Improvedebugging accuracyVSAvoidbuild time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent enables incremental compilation by segmenting the recompilation process to affect only marked code regions and their dependents rather than the entire codebase. The compiler identifies and recompiles only the necessary portions while preserving optimized binaries for unaffected code.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary analysis during compilation to identify code regions that depend on marked functions. This allows the system to pre-determine the minimal set of code that needs recompilation, avoiding unnecessary rebuilds and reducing build time.

Inventive Principle:
Principle #10Preliminary action

3Adaptability or versatility

If optimization markers are added to source code, then Edit-and-Continue capability is improved, but code complexity increases

Engineering Contradiction:
ImproveEdit-and-Continue capabilityVSAvoidcode complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent introduces compiler pragmas and markers as intermediary elements between the source code and the compilation process. These intermediaries provide a clean, standardized interface for controlling optimization behavior without requiring complex build system changes or IDE modifications.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Productivity

If incremental compilation is implemented, then build efficiency is improved, but compilation system complexity increases

Engineering Contradiction:
Improvebuild efficiencyVSAvoidcompilation system complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent performs preliminary dependency analysis during the initial compilation pass to build a dependency graph. This pre-computed information enables rapid identification of affected code regions during incremental compilation, avoiding the need for complex real-time analysis during rebuild operations.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentEP3161642B1Techniques for edit-and-continue and enhanced optimized debugging on optimized code
Publication Date: 2020.07.22 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP3161642B1 patent drawingFigure 1~2
  • EP3161642B1 patent drawingFigure 3
  • EP3161642B1 patent drawingFigure 4

AI summary

Methods, systems, and computer program products are provided that enable a portion of code to be marked in source code to disable compilation optimizations for the marked portion of code, while the rest of the source code is compiled with optimizations. In this manner, edit-and-continue debugging may be performed on the compiled source code in an enhanced manner. Modifications made to the marked source code (as well as the rest of the source code) may be compiled in an incremental manner, such that the portions of the source code affected by the modifications are compiled, while unaffected portions of the source code are not recompiled.