Partager via


Expression Evaluation in Break Mode

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

The following describes the process that occurs when the debugger is in break mode and must conduct expression evaluation.

Expression Evaluation Process

These are the basic steps involved in evaluating an expression:

  1. The session debug manager (SDM) calls IDebugStackFrame2::GetExpressionContext to obtain an expression context interface, IDebugExpressionContext2.

  2. The SDM then calls IDebugExpressionContext2::ParseText with the string to be parsed.

  3. If ParseText does not return S_OK, the reason for the error is returned.

    -otherwise-

    If ParseText does return S_OK, the SDM can then call either IDebugExpression2::EvaluateSync or IDebugExpression2::EvaluateAsync to obtain a final value from the parsed expression.

    • In the case of using IDebugExpression2::EvaluateSync, the given callback interface is used to communicate the ongoing process of the evaluation. The final value is returned in an IDebugProperty2 interface.

    • In the case of using IDebugExpression2::EvaluateAsync, the given callback interface is used to communicate the ongoing process of the evaluation. Once the evaluation is complete, EvaluateAsync sends an IDebugExpressionEvaluationCompleteEvent2 interface through the callback. With this event interface, the final value can be obtained with GetResult.

See Also

Calling Debugger Events