Exemplo n.º 1
0
        static void Override()
        {
            try
            {
                Monitor.Enter(TrampolineInitializer.Sync);

                TrampolineHandler.Action(null, TrampolineInitializer.Data);
            }
            finally
            {
                Monitor.Exit(TrampolineInitializer.Sync);
            }
        }
Exemplo n.º 2
0
        static object Override()
        {
            try
            {
                Monitor.Enter(TrampolineInitializer.Sync);

                object result = TrampolineHandler.Func(null, TrampolineInitializer.Data);

                return(result);
            }
            finally
            {
                Monitor.Exit(TrampolineInitializer.Sync);
            }
        }
Exemplo n.º 3
0
            public OperationNativeTrampoline(SingleSteppingEngine sse, TargetAddress trampoline,
						  TrampolineHandler handler)
                : base(sse, null)
            {
                this.TrampolineHandler = handler;
                this.Trampoline = trampoline;
            }
Exemplo n.º 4
0
            public OperationMonoTrampoline(SingleSteppingEngine sse, Instruction call_site,
						TargetAddress trampoline, TrampolineHandler handler)
                : base(sse, null)
            {
                this.CallSite = call_site;
                this.Trampoline = trampoline;
                this.TrampolineHandler = handler;
            }
Exemplo n.º 5
0
        protected bool CheckTrampoline(Instruction instruction, TrampolineHandler handler)
        {
            TargetAddress trampoline;
            Instruction.TrampolineType type = instruction.CheckTrampoline (
                inferior, out trampoline);
            if (type == Instruction.TrampolineType.None)
                return false;

            Report.Debug (DebugFlags.SSE,
                      "{0} found trampoline {1}:{2} at {3} while running {4}",
                      this, type, trampoline, instruction.Address, current_operation);

            if (type == Instruction.TrampolineType.NativeTrampolineStart) {
                PushOperation (new OperationNativeTrampoline (this, trampoline, handler));
                return true;
            } else if (type == Instruction.TrampolineType.NativeTrampoline) {
                Method method = Lookup (trampoline);
                if (!MethodHasSource (method))
                    do_next ();
                else
                    do_continue (trampoline);
                return true;
            } else if (type == Instruction.TrampolineType.MonoTrampoline) {
                PushOperation (new OperationMonoTrampoline (
                    this, instruction, trampoline, handler));
                return true;
            } else if (type == Instruction.TrampolineType.DelegateInvoke) {
                PushOperation (new OperationDelegateInvoke (this));
                return true;
            }

            return false;
        }