本文整理汇总了C#中IDebugProperty2类的典型用法代码示例。如果您正苦于以下问题:C# IDebugProperty2类的具体用法?C# IDebugProperty2怎么用?C# IDebugProperty2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDebugProperty2类属于命名空间,在下文中一共展示了IDebugProperty2类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DebugPropertyCreateEvent
public DebugPropertyCreateEvent(enum_EVENTATTRIBUTES attributes, IDebugProperty2 property)
: base(attributes)
{
Contract.Requires<ArgumentNullException>(property != null, "property");
_property = property;
}
示例2: GetMethodProperty
public int GetMethodProperty(IDebugSymbolProvider pSymbolProvider, IDebugAddress pAddress, IDebugBinder pBinder, int fIncludeHiddenLocals, out IDebugProperty2 ppProperty)
{
AD7Property method = new AD7Property(m_var);
ppProperty = method;
return VSConstants.S_OK;
}
示例3: DebugReturnValueEvent
public DebugReturnValueEvent(enum_EVENTATTRIBUTES attributes, IDebugProperty2 returnValue)
: base(attributes)
{
Contract.Requires<ArgumentNullException>(returnValue != null, "returnValue");
_returnValue = returnValue;
}
示例4: AutoResetEvent
// This method evaluates the expression synchronously.
int IDebugExpression2.EvaluateSync(enum_EVALFLAGS dwFlags, uint dwTimeout, IDebugEventCallback2 pExprCallback, out IDebugProperty2 ppResult) {
AutoResetEvent completion = new AutoResetEvent(false);
PythonEvaluationResult result = null;
_frame.StackFrame.ExecuteText(_expression, (obj) => {
result = obj;
completion.Set();
});
while (!_frame.StackFrame.Thread.Process.HasExited && !completion.WaitOne(Math.Min((int)dwTimeout, 100))) {
if (dwTimeout <= 100) {
break;
}
dwTimeout -= 100;
}
if (_frame.StackFrame.Thread.Process.HasExited || result == null) {
ppResult = null;
return VSConstants.E_FAIL;
} else if (result == null) {
ppResult = null;
return DebuggerConstants.E_EVALUATE_TIMEOUT;
}
ppResult = new AD7Property(_frame, result, _writable);
return VSConstants.S_OK;
}
示例5: JavaDebugProperty
public JavaDebugProperty(IDebugProperty2 parent, EvaluatedExpression evaluatedExpression)
{
Contract.Requires<ArgumentNullException>(evaluatedExpression != null, "evaluatedExpression");
_parent = parent;
_evaluatedExpression = evaluatedExpression;
}
示例6: ConstructErrorPropertyInfo
public static DEBUG_PROPERTY_INFO ConstructErrorPropertyInfo(enum_DEBUGPROP_INFO_FLAGS dwFields, string name, string error, IDebugProperty2 prop)
{
DEBUG_PROPERTY_INFO property = new DEBUG_PROPERTY_INFO(); ;
if ((dwFields & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME) != 0)
{
property.bstrName = name;
property.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME;
}
if ((dwFields & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE) != 0)
{
property.bstrValue = error;
property.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE;
}
if ((dwFields & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB) != 0)
{
property.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_ERROR;
}
if ((dwFields & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP) != 0)
{
property.pProperty = prop;
property.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP;
}
return property;
}
示例7: DebugExpressionEvaluationCompleteEvent
public DebugExpressionEvaluationCompleteEvent(enum_EVENTATTRIBUTES attributes, IDebugExpression2 expression, IDebugProperty2 property)
: base(attributes)
{
Contract.Requires<ArgumentNullException>(expression != null, "expression");
Contract.Requires<ArgumentNullException>(property != null, "property");
_expression = expression;
_property = property;
}
示例8: EvaluateSync
/// <summary>
/// This method evaluates the expression synchronously.
/// </summary>
public int EvaluateSync(enum_EVALFLAGS dwFlags, uint dwTimeout, IDebugEventCallback2 pExprCallback,
out IDebugProperty2 ppResult)
{
ppResult = null;
int idx = _index;
if (string.IsNullOrEmpty(_castExpr))
{
var reg = _stackFrame.GetRegistersAsync().Await((int) dwTimeout)
.FirstOrDefault(r => r.Name == _registerType + _index);
if (reg != null)
{
ppResult = new DebugStackFrameValueProperty(reg, null, _stackFrame);
return VSConstants.S_OK;
}
}
else
{
var tag = GetTagFromString(_castExpr);
if (!tag.IsPrimitive() && (dwFlags & enum_EVALFLAGS.EVAL_NOSIDEEFFECTS) != 0)
{
// this evaluation has "side effects" in that it might crash the VM
// if the cast is to "object" or "string", but the register does not
// hold an object or string.
ppResult = new DebugConstProperty(_expression, "(this cast might crash the VM if the register is not of the casted type)", _castExpr, null)
{ HasSideEffects = true };
return VSConstants.E_FAIL;
}
var isParam = _registerType == "p";
if (isParam)
{
var loc = _stackFrame.GetDocumentLocationAsync().Await((int) dwTimeout);
if (loc == null)
return VSConstants.E_FAIL;
var methodDiss = _stackFrame.Thread.Program.DisassemblyProvider.GetFromLocation(loc);
if (methodDiss == null)
return VSConstants.E_FAIL;
idx += methodDiss.Method.Body.Registers.Count - methodDiss.Method.Body.IncomingArguments;
}
var reg = _stackFrame.GetRegistersAsync(false, tag, idx).Await((int) dwTimeout);
if (reg != null && reg.Count > 0)
{
ppResult = new DebugStackFrameValueProperty(reg[0], null, _stackFrame, _expression)
{
HasSideEffects = !tag.IsPrimitive()
};
return VSConstants.S_OK;
}
}
return VSConstants.E_FAIL;
}
示例9: EvaluateSync
/// <summary>
/// This method evaluates the expression synchronously.
/// </summary>
/// <param name="dwFlags">A combination of flags from the EVALFLAGS enumeration that control expression evaluation.</param>
/// <param name="dwTimeout">Maximum time, in milliseconds, to wait before returning from this method. Use INFINITE to wait indefinitely.</param>
/// <param name="pExprCallback">This parameter is always a null value.</param>
/// <param name="ppResult">Returns the IDebugProperty2 object that contains the result of the expression evaluation.</param>
/// <returns>
/// If successful, returns S_OK; otherwise returns an error code. Some typical error codes are:
/// Error Description
/// E_EVALUATE_BUSY_WITH_EVALUATION Another expression is currently being evaluated, and simultaneous expression evaluation is not supported.
/// E_EVALUATE_TIMEOUT Evaluation timed out.
/// </returns>
/// <remarks>For synchronous evaluation, it is not necessary to send an event back to Visual Studio upon completion of the evaluation.</remarks>
public int EvaluateSync( enum_EVALFLAGS dwFlags,
uint dwTimeout,
IDebugEventCallback2 pExprCallback,
out IDebugProperty2 ppResult)
{
Logger.Debug( string.Empty );
ppResult = null;
return VSConstants.E_NOTIMPL;
}
示例10: JavaDebugStaticMembersPseudoProperty
public JavaDebugStaticMembersPseudoProperty(IDebugProperty2 parent, IReferenceType referenceType, IEnumerable<IField> fields)
{
Contract.Requires<ArgumentNullException>(parent != null, "parent");
Contract.Requires<ArgumentNullException>(referenceType != null, "referenceType");
_parent = parent;
_referenceType = referenceType;
if (fields != null)
_fields = fields.ToArray();
}
示例11: EvaluateSync
/// <summary>
/// This method evaluates the expression synchronously.
/// </summary>
/// <param name="dwFlags">[in] A combination of flags from the EVALFLAGS enumeration that control expression evaluation.</param>
/// <param name="dwTimeout">[in] Maximum time, in milliseconds, to wait before returning from this method. Use INFINITE to wait indefinitely.</param>
/// <param name="pExprCallback">[in]This parameter is always a null value.</param>
/// <param name="ppResult">[out] Returns the IDebugProperty2 object that contains the result of the expression evaluation.</param>
/// <returns>
/// If successful, returns S_OK; otherwise returns an error code. Some typical error codes are:
/// * E_EVALUATE_BUSY_WITH_EVALUATION Another expression is currently being evaluated, and simultaneous
/// expression evaluation is not supported.
/// * E_EVALUATE_TIMEOUT Evaluation timed out.
/// </returns>
/// <remarks>
/// For synchronous evaluation, it is not necessary to send an event back to Visual Studio upon completion of the evaluation.
/// </remarks>
public int EvaluateSync(enum_EVALFLAGS dwFlags, uint dwTimeout, IDebugEventCallback2 pExprCallback, out IDebugProperty2 ppResult)
{
ppResult = null;
Task<IDebugProperty2> task = Task.Factory.StartNew(() => EvaluateImpl(dwFlags)).HandleNonCriticalExceptions();
if (!task.Wait((int)dwTimeout))
return AD7Constants.E_EVALUATE_TIMEOUT;
if (task.Status != TaskStatus.RanToCompletion || task.Result == null)
return VSConstants.E_FAIL;
ppResult = task.Result;
return VSConstants.S_OK;
}
示例12: EvaluateSync
/// <summary>
/// This method evaluates the expression synchronously.
/// </summary>
public int EvaluateSync(enum_EVALFLAGS dwFlags, uint dwTimeout, IDebugEventCallback2 pExprCallback,
out IDebugProperty2 ppResult)
{
ppResult = null;
if (string.IsNullOrEmpty(_castExpr))
{
var reg = _stackFrame.GetRegistersAsync().Await((int) dwTimeout)
.FirstOrDefault(r => r.Name == _registerType + _index);
if (reg != null)
{
ppResult = new DebugStackFrameValueProperty(reg, null, _stackFrame);
return VSConstants.S_OK;
}
}
else
{
var tag = GetTagFromString(_castExpr);
if (!tag.IsPrimitive() && (dwFlags & enum_EVALFLAGS.EVAL_NOSIDEEFFECTS) != 0)
{
// this evaluation has "side effects" in that it might crash the VM
// if the cast is to "object" or "string", but the register does not
// hold an object or string.
ppResult = new DebugConstProperty(_expression, "(this cast might crash a DalvikVM if the register is not of the casted type)", _castExpr, null)
{ HasSideEffects = true };
return VSConstants.E_FAIL;
}
var regNames = _stackFrame.GetRegisterNamesAsync().Await((int)dwTimeout);
var vmIdx = regNames.GetVmIndex(_registerType == "p", _index);
if (vmIdx < 0)
return VSConstants.E_FAIL;
var reg = _stackFrame.GetRegistersAsync(false, tag, vmIdx).Await((int)dwTimeout);
if (reg != null && reg.Count > 0)
{
ppResult = new DebugStackFrameValueProperty(reg[0], null, _stackFrame, _expression)
{
HasSideEffects = !tag.IsPrimitive()
};
return VSConstants.S_OK;
}
}
return VSConstants.E_FAIL;
}
示例13: AD7Property
int IDebugExpression2.EvaluateSync(
enum_EVALFLAGS dwFlags,
uint dwTimeout,
IDebugEventCallback2 pExprCallback,
out IDebugProperty2 ppResult)
{
if (MySql.Debugger.Debugger.GetTagHashCode(_stackFrame._rs.OwningRoutine.SourceCode) !=
DebuggerManager.Instance.Debugger.CurrentScope.OwningRoutine.Hash)
{
// This should never happen.
ppResult = null;
return VSConstants.E_NOTIMPL;
}
AD7Property prop = new AD7Property( _expr,_stackFrame.Node, _stackFrame._rs );
ppResult = prop;
// Send evaluation complete event
DebuggerManager.Instance._events.ExpressionEvalCompleted(
_stackFrame.Node, ( IDebugExpression2 )this, ( IDebugProperty2 )prop );
return VSConstants.S_OK;
}
示例14: catch
// This method evaluates the expression synchronously.
int IDebugExpression2.EvaluateSync(enum_EVALFLAGS dwFlags, uint dwTimeout, IDebugEventCallback2 pExprCallback, out IDebugProperty2 ppResult)
{
NodeEvaluationResult result;
ppResult = null;
try
{
result = _frame.StackFrame.EvaluateExpressionAsync(_expression).Result;
}
catch (Exception)
{
return VSConstants.E_FAIL;
}
if (result == null)
{
return VSConstants.E_FAIL;
}
ppResult = new AD7Property(result);
return VSConstants.S_OK;
}
示例15:
// This method evaluates the expression synchronously.
int IDebugExpression2.EvaluateSync(enum_EVALFLAGS dwFlags, uint dwTimeout, IDebugEventCallback2 pExprCallback, out IDebugProperty2 ppResult)
{
ppResult = null;
if ((dwFlags & enum_EVALFLAGS.EVAL_NOSIDEEFFECTS) != 0 && _var.IsVisualized)
{
IVariableInformation variable = DebuggedProcess.g_Process.Natvis.Cache.Lookup(_var);
if (variable == null)
{
ppResult = new AD7ErrorProperty(_var.Name, ResourceStrings.NoSideEffectsVisualizerMessage);
}
else
{
_var = variable;
ppResult = new AD7Property(_var);
}
return Constants.S_OK;
}
_var.SyncEval();
ppResult = new AD7Property(_var);
return Constants.S_OK;
}