Binary Mapping Rerouting for Optimized Code Debugging
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Debugging optimized code is inefficient due to missing context information, erratic debugger stepping behavior, and the need for frequent recompilation, especially in game development, where non-optimized builds are too slow and optimized builds lack necessary debugging tools.
Innovation Solution
A system and method for dynamically mapping and rerouting between optimized and non-optimized binaries during debugging, using metadata and dependency graphs to seamlessly switch between the two, allowing breakpoints in optimized code to redirect to non-optimized code for context information and back, reducing the need for recompilation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of information
If non-optimized builds are used for debugging, then context information and debugging tools are available, but execution speed is too slow making games unplayable
Solution Approach 1:
The system segments the binary into optimized portions and non-optimized portions, allowing different sections to serve different purposes. The non-optimized portions provide debugging context while optimized portions maintain performance, resolving the contradiction between information availability and execution speed.
Solution Approach 2:
Different portions of the binary have different optimization qualities. Specifically optimized portions run at high speed while non-optimized portions provide debugging information. This local differentiation allows the system to have both fast execution and adequate debugging information simultaneously.
2Speed
If optimized builds are used for debugging, then execution speed is improved, but debugger stepping behavior becomes erratic and context information is lost
Solution Approach 1:
The binary is divided into optimized and non-optimized segments with distinct roles. The non-optimized segments act as stable anchor points for debugger operations, providing consistent stepping behavior while optimized segments maintain high execution speed, thus resolving the contradiction between speed and debugger reliability.
3Loss of information
If optimizations are disabled for relevant functions, then debugging context is preserved, but recompilation time increases
Solution Approach 1:
The system performs preliminary compilation creating both optimized and non-optimized portions of the binary before debugging sessions begin. This pre-prepared structure eliminates the need for repeated recompilation during debugging, as the non-optimized portions are already available to provide debugging context without requiring additional build time.
4Ease of operation
If breakpoints are set in optimized code, then debugging can proceed, but relevant context information is omitted from the optimized build
Solution Approach 1:
The non-optimized portions of the binary act as intermediaries that provide the missing context information. When debugging optimized code, the system can reference the corresponding non-optimized portions to retrieve context information that was stripped during optimization, thus resolving the contradiction between debugging capability and information availability.
Data Source
AI summary
Systems, methods, and devices are provided for dynamically mapping and rerouting a non-optimized binary to an optimized binary. Embodiments identify a position-independent portion within a non-optimized binary and receive metadata associated with an optimized binary. Further, embodiments identify a location identifier within the optimized binary from the metadata and generate a delta value between the position-independent portion and the location identifier. Embodiments also update the position-independent portion with the delta value.


