Ejemplo n.º 1
0
        public void CallParameterizedFunction(CorFunction managedFunction, CorType[] argumentTypes, CorValue[] arguments)
        {
            ICorDebugType[] types       = null;
            int             typesLength = 0;

            ICorDebugValue[] values = null;
            int valuesLength        = 0;

            ICorDebugEval2 eval2 = (ICorDebugEval2)m_eval;

            if (argumentTypes != null)
            {
                types = new ICorDebugType[argumentTypes.Length];
                for (int i = 0; i < argumentTypes.Length; i++)
                {
                    types[i] = argumentTypes[i].m_type;
                }
                typesLength = types.Length;
            }
            if (arguments != null)
            {
                values = new ICorDebugValue[arguments.Length];
                for (int i = 0; i < arguments.Length; i++)
                {
                    values[i] = arguments[i].m_val;
                }
                valuesLength = values.Length;
            }
            eval2.CallParameterizedFunction(managedFunction.m_function, (uint)typesLength, types, (uint)valuesLength, values);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets up a call to the specified function
 /// </summary>
 /// <param name="func">Method</param>
 /// <param name="typeArgs">Type and method arguments, in that order, or null if none needed</param>
 /// <param name="args">Arguments</param>
 /// <returns></returns>
 public int CallParameterizedFunction(CorFunction func, CorType[] typeArgs, CorValue[] args)
 {
     if (eval2 == null)
     {
         if (typeArgs == null || typeArgs.Length == 0)
         {
             return(CallFunction(func, args));
         }
         return(-1);
     }
     return(eval2.CallParameterizedFunction(func.RawObject, typeArgs == null ? 0 : typeArgs.Length, typeArgs.ToCorDebugArray(), args.Length, args.ToCorDebugArray()));
 }
Ejemplo n.º 3
0
        private void InvokeAssemblyLoad(ICorDebugEval2 eval, ICorDebugValue assemblyCodeInTargetProcess)
        {
            Logger.WriteLine("Calling Assembly.Load()");

            ICorDebugType[] types = new ICorDebugType[0];
            ICorDebugValue[] values = new ICorDebugValue[1] { assemblyCodeInTargetProcess };

            eval.CallParameterizedFunction(_loadAssemblyMethod.Interface, 0, types, (uint)values.Length, values);
            Logger.WriteLine("Assembly.Load() call made. Waiting for results.");
        }