Expression evaluators (EE) examine the syntax of a language to parse and evaluate variables and expressions at run time, allowing them to be viewed by the user when the IDE is in break mode.
Expressions are created using themethod, as follows:
The debug engine (DE) implements theinterface.
The debug package gets an IDebugExpressionContext2 object from aninterface and then calls the IDebugStackFrame2::ParseText method on it to get an object.
The debug package calls themethod or the method to get the value of the expression. IDebugExpression2::EvaluateAsync is called from the Command/Immediate window. All other UI components call IDebugExpression2::EvaluateSync.
The result of expression evaluation is anobject, which contains the name, type, and value of the result of the expression evaluation.
During expression evaluation, the EE requires information from the symbol provider component. The symbol provider supplies the symbolic information used for identifying and understanding the parsed expression.
When asynchronous expression evaluation is complete, an asynchronous event is sent by the DE through the session debug manager (SDM) to notify the IDE that expression evaluation is complete. When synchronous expression evaluation is complete, the result of the evaluation is returned from the call to the IDebugExpression2::EvaluateSync method.
The Visual Studio debug engines expect to talk with the expression evaluator using Common Language Runtime (CLR) interfaces. As a result, an expression evaluator that works with the Visual Studio debug engines must support the CLR (a complete list of all CLR debugging interfaces can be found in debugref.doc, which is part of the .NET Framework SDK).