Ejemplo n.º 1
0
        internal DbgDotNetValueResult FuncEvalCall_MonoDebug(DbgEvaluationInfo evalInfo, DmdMethodBase method, DbgDotNetValue obj, object[] arguments, DbgDotNetInvokeOptions invokeOptions, bool newObj)
        {
            debuggerThread.VerifyAccess();
            evalInfo.CancellationToken.ThrowIfCancellationRequested();
            var tmp = CheckFuncEval(evalInfo.Context);

            if (tmp != null)
            {
                return(tmp.Value);
            }
            return(FuncEvalCallCore_MonoDebug(evalInfo.Context, evalInfo.Frame, evalInfo.Frame.Thread, method, obj, arguments, invokeOptions, newObj, evalInfo.CancellationToken));
        }
Ejemplo n.º 2
0
 DbgDotNetValueResult FuncEvalCallCore_MonoDebug(DbgEvaluationContext contextOpt, DbgStackFrame frameOpt, DbgThread thread, DmdMethodBase method, DbgDotNetValue obj, object[] arguments, DbgDotNetInvokeOptions invokeOptions, bool newObj, CancellationToken cancellationToken)
 {
     // ReturnOutThis is only available since 2.35 so we'll special case the common case where a struct ctor
     // is called (CALL/CALLVIRT). We'll change it to a NEWOBJ and then copy the result to the input 'this' value.
     if (!newObj && obj is DbgDotNetValueImpl objImpl && method is DmdConstructorInfo ctor && ctor.ReflectedType.IsValueType)
     {
         var res = FuncEvalCallCoreReal_MonoDebug(contextOpt, frameOpt, thread, method, null, arguments, invokeOptions, true, cancellationToken);
         if (res.IsNormalResult)
         {
             try {
                 var error = objImpl.ValueLocation.Store(((DbgDotNetValueImpl)res.Value).Value);
                 if (error != null)
                 {
                     res.Value?.Dispose();
                     return(DbgDotNetValueResult.CreateError(error));
                 }
             }
             catch {
                 res.Value?.Dispose();
                 throw;
             }
         }
         return(res);
     }
Ejemplo n.º 3
0
        internal DbgDotNetValueResult FuncEvalCall_AnyThread_MonoDebug(DmdMethodBase method, DbgDotNetValue obj, object[] arguments, DbgDotNetInvokeOptions invokeOptions, bool newObj)
        {
            debuggerThread.VerifyAccess();
            var cancellationToken = CancellationToken.None;

            foreach (var thread in GetFuncEvalCallThreads(method.AppDomain))
            {
                var res = FuncEvalCallCore_MonoDebug(null, null, thread, method, obj, arguments, invokeOptions, newObj, cancellationToken);
                if (!res.HasError)
                {
                    return(res);
                }
            }
            return(DbgDotNetValueResult.CreateError(PredefinedEvaluationErrorMessages.InternalDebuggerError));
        }