Exemple #1
0
        /// <summary>
        /// Invoke an "island", marshaling the arguments.
        /// Called on debugger worker thread.
        /// </summary>
        private static void InvokeIsland(Object islandThread, VirtualStackFrame frame)
        {
            Object[] arguments = new Object[1 + frame.State.EarlyLocalsTypes.Count];
            arguments[0] = islandThread;

            int i = 1;

            foreach (DebuggerLocalType localType in frame.State.EarlyLocalsTypes)
            {
                object value;
                ErrorUtilities.VerifyThrow(frame.Locals.TryGetValue(localType.Name, out value), "Didn't define value for {0}", localType.Name);

                arguments[i] = value;
                i++;
            }

            // ReflectionPermission perm = new ReflectionPermission(ReflectionPermissionFlag.MemberAccess);
            // perm.Assert();
            // frame.State.MethodInfo.Invoke(null /* no instance */, BindingFlags.NonPublic | BindingFlags.Static, null /* default binder */, args2, null /* default culture */);
            frame.State.Method.Invoke(null /* no instance */, arguments);
        }
        /// <summary>
        /// Invoke an "island", marshaling the arguments.
        /// Called on debugger worker thread.
        /// </summary>
        private static void InvokeIsland(Object islandThread, VirtualStackFrame frame)
        {
            Object[] arguments = new Object[1 + frame.State.EarlyLocalsTypes.Count];
            arguments[0] = islandThread;

            int i = 1;
            foreach (DebuggerLocalType localType in frame.State.EarlyLocalsTypes)
            {
                object value;
                ErrorUtilities.VerifyThrow(frame.Locals.TryGetValue(localType.Name, out value), "Didn't define value for {0}", localType.Name);

                arguments[i] = value;
                i++;
            }

            // ReflectionPermission perm = new ReflectionPermission(ReflectionPermissionFlag.MemberAccess);
            // perm.Assert();
            // frame.State.MethodInfo.Invoke(null /* no instance */, BindingFlags.NonPublic | BindingFlags.Static, null /* default binder */, args2, null /* default culture */);
            frame.State.Method.Invoke(null /* no instance */, arguments);
        }