Selective Function Unoptimization for Debugging Optimized Code
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Debugging optimized code is challenging due to issues like the 'hopping Program Counter' problem, 'cross-jumping,' and 'roving variables' caused by optimizations, which invalidate debugging data and make it difficult for developers to inspect variables and follow code execution.
Innovation Solution
A software development system that allows users to selectively unoptimize or re-optimize functions within the source code during debugging, enabling an edit and continue operation to generate a compiled version with specific functions unoptimized or re-optimized, while others remain optimized, using features like #pragma optimize directives and incremental compilation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If code optimization is applied to improve execution speed and resource efficiency, then program performance is improved, but debugging difficulty increases due to hopping program counter, cross-jumping, and roving variable phenomena
Solution Approach 1:
The patent segments the code into optimized and unoptimized portions, allowing different compilation modes for different functions. The system divides the program into modules where critical performance functions remain optimized while debugging-related functions are unoptimized, enabling simultaneous achievement of execution speed and debugging ease through selective compilation strategies.
2Use of energy by moving object
If full optimization is applied to the entire program, then resource efficiency is improved, but code modifiability during debugging deteriorates
Solution Approach 1:
The patent implements dynamic optimization control where the optimization state of code segments can change during the development process. The system allows developers to dynamically adjust which functions are optimized versus unoptimized based on debugging needs, enabling the program to adapt its optimization level without requiring full recompilation, thus maintaining both resource efficiency and code modifiability.
3Ease of operation
If selective unoptimization of individual functions is enabled during debugging, then debugging ease is improved, but compilation complexity increases
Solution Approach 1:
The patent implements self-service mechanisms where the compilation system automatically manages the complexity of selective optimization. The compiler automatically identifies which functions should be optimized versus unoptimized based on developer preferences or analysis, and handles the recompilation process automatically, freeing developers from manually managing compilation complexity while still enabling selective unoptimization for debugging purposes.
Data Source
AI summary
A software development system is described that enables a user that is debugging source code to select for unoptimizing a function within the source code and to cause an edit and continue operation to be performed that produces a compiled version of the source code in which the selected function is unoptimized, while other functions remain optimized. Embodiments also enable a user to select a previously unoptimized function within the source code for re-optimizing and to cause an edit and continue operation to be performed that produces a compiled version of the source code in which the function is re-optimized. Still further embodiments enable a user to select within source code that is being developed a function for which optimization should be prevented and to cause a compiled representation of the source code to be built in which the selected function is unoptimized, while other functions are optimized.


