Cosmos/source/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Expression.cs

52 lines
No EOL
2.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Debugger.Interop;
using Cosmos.Debug.Common;
namespace Cosmos.Debug.VSDebugEngine
{
// This class represents a succesfully parsed expression to the debugger.
// It is returned as a result of a successful call to IDebugExpressionContext2.ParseText
// It allows the debugger to obtain the values of an expression in the debuggee.
// For the purposes of this sample, this means obtaining the values of locals and parameters from a stack frame.
public class AD7Expression : IDebugExpression2
{
private DebugLocalInfo m_var;
private AD7Process Process;
private AD7StackFrame StackFrame;
public AD7Expression(DebugLocalInfo pVar, AD7Process pProcess, AD7StackFrame pStackFrame)
{
this.m_var = pVar;
this.Process = pProcess;
this.StackFrame = pStackFrame;
}
// This method cancels asynchronous expression evaluation as started by a call to the IDebugExpression2::EvaluateAsync method.
int IDebugExpression2.Abort()
{
throw new NotImplementedException();
}
// This method evaluates the expression asynchronously.
// This method should return immediately after it has started the expression evaluation.
// When the expression is successfully evaluated, an IDebugExpressionEvaluationCompleteEvent2
// must be sent to the IDebugEventCallback2 event callback
//
// This is primarily used for the immediate window which this engine does not currently support.
int IDebugExpression2.EvaluateAsync(enum_EVALFLAGS dwFlags, IDebugEventCallback2 pExprCallback)
{
throw new NotImplementedException();
}
// This method evaluates the expression synchronously.
int IDebugExpression2.EvaluateSync(enum_EVALFLAGS dwFlags, uint dwTimeout, IDebugEventCallback2 pExprCallback, out IDebugProperty2 ppResult)
{
ppResult = new AD7Property(m_var, Process, StackFrame);
return VSConstants.S_OK;
}
}
}