Debug Expression Evaluation via Embedded AST Nodes
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Debugging applications often require evaluating expressions within a paused program execution, which can be inefficient due to the need for custom expression evaluators and keeping debuggers updated with various compiler implementations.
Innovation Solution
The system embeds abstract syntax trees in debugging information generated by the compiler, allowing the debugger to evaluate expressions without requiring a separate expression evaluator, reducing the need for frequent updates and improving debugging efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If a debugger uses a separate custom expression evaluator to evaluate expressions during debugging, then expression evaluation capability is achieved, but device complexity and maintenance burden increase
Solution Approach 1:
The patent merges the expression evaluation functionality directly into the debugger by embedding an expression evaluator component within the debugger architecture. This integration eliminates the need for separate external evaluators while maintaining full expression evaluation capability during debugging sessions.
Solution Approach 2:
The embedded expression evaluator is designed to handle multiple types of expressions and data structures universally. It can evaluate expressions against various debugging data types (variables, memory contents, register values) without requiring separate specialized evaluators for each type, thereby reducing overall system complexity.
2Adaptability or versatility
If the debugger is frequently updated to keep pace with compiler implementations, then compatibility with latest compiler features is maintained, but loss of time and productivity decrease
Solution Approach 1:
The expression evaluator is pre-configured with knowledge of debugging data types and evaluation rules that are established by compiler standards. This preliminary setup allows the debugger to handle current and future compiler implementations without requiring frequent updates, as the evaluator is designed to be forward-compatible with compiler evolution.
Solution Approach 2:
The system allows for parameter adjustments in the expression evaluator to adapt to different compiler versions and implementations. Rather than requiring structural changes or complete rewrites, simple parameter modifications enable the debugger to maintain compatibility across compiler updates, thereby preserving productivity.
3Ease of operation
If the debugger includes comprehensive expression evaluation functionality, then debugging capability is improved, but debugging data size and processing overhead increase
Solution Approach 1:
The expression evaluation logic is extracted as a separate, modular component within the debugger architecture. This extracted evaluator can be selectively activated only when expression evaluation is needed, rather than being permanently embedded in all debugging operations. This reduces the overall data processing overhead while maintaining full capability when required.
Data Source
AI summary
A system for expression evaluation at debug time includes a debugger which receives an executable program with debugging information from a compiler, where the executable program with the debugging information is generated by compiling a source code program and generating debugging information corresponding to the executable program. The compiler embeds at least a first abstract syntax tree of a first expression of the source code program in the debugging information. The debugger receives a first debugging command from a debugger client to evaluate a selected portion of the first expression. The debugger determines one or more nodes of the abstract syntax tree that correspond to the selected portion of the first expression. The debugger then steps through and evaluates the one or more nodes of the abstract syntax tree and returns one or more values generated by the evaluation.


