Debugger.GetExpression Method

Evaluates an expression based on the current stack frame. If the expression can be parsed but not evaluated, an object is returned but will not contain a valid value.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
Function GetExpression ( _
    ExpressionText As String, _
    UseAutoExpandRules As Boolean, _
    Timeout As Integer _
) As Expression
'Usage
Dim instance As Debugger 
Dim ExpressionText As String 
Dim UseAutoExpandRules As Boolean 
Dim Timeout As Integer 
Dim returnValue As Expression 

returnValue = instance.GetExpression(ExpressionText, _
    UseAutoExpandRules, Timeout)
Expression GetExpression(
    string ExpressionText,
    bool UseAutoExpandRules,
    int Timeout
)
Expression^ GetExpression(
    [InAttribute] String^ ExpressionText, 
    [InAttribute] bool UseAutoExpandRules, 
    [InAttribute] int Timeout
)
function GetExpression(
    ExpressionText : String, 
    UseAutoExpandRules : boolean, 
    Timeout : int
) : Expression

Parameters

  • ExpressionText
    Type: System.String

    The expression text to be evaluated.

  • UseAutoExpandRules
    Type: System.Boolean

    true if the auto expand rules should be used; otherwise, false.

  • Timeout
    Type: System.Int32

    The timeout period, in milliseconds.

Return Value

Type: EnvDTE.Expression
A Expression object.

Remarks

GetExpression evaluates an expression based on the current stack frame. If the expression can be parsed but not evaluated, an object is returned but will not contain a valid value.

Examples

The following example demonstrates how to use M:EnvDTE.Debugger.GetExpression(System.String,System.Boolean,System.Int32) property.

Sub DisplayExpression(Optional ByVal str As String = "")
    Dim expr As Expression
    expr = DTE.Debugger.GetExpression(str)

    If (expr.IsValidValue) Then
        MsgBox(expr.Name + " = " + expr.Value)
    Else
        MsgBox("Expression was not valid")
    End If

End Sub

.NET Framework Security

See Also

Reference

Debugger Interface

Debugger Members

EnvDTE Namespace