Mono.Debugger.Backend.SingleSteppingEngine.OperationRuntimeInvoke.OperationRuntimeInvokeHelper.do_execute C# (CSharp) Method

do_execute() private method

private do_execute ( ) : void
return void
                void do_execute()
                {
                    switch (stage) {
                    case Stage.Uninitialized: {
                    class_info = RTI.Function.ResolveClass (inferior, false);
                    if (class_info != null)
                        goto case Stage.ResolvedClass;

                    MonoClassType klass = RTI.Function.DeclaringType as MonoClassType;
                    if (klass == null)
                        throw new TargetException (TargetError.ClassNotInitialized,
                                       "Class `{0}' not initialized yet.",
                                       RTI.Function.DeclaringType.Name);

                    TargetAddress image = RTI.Function.SymbolFile.MonoImage;
                    int token = klass.Token;

                    Report.Debug (DebugFlags.SSE,
                              "{0} rti resolving class {1}:{2:x}", sse, image, token);

                    inferior.CallMethod (
                        sse.MonoDebuggerInfo.LookupClass, image.Address, 0, 0,
                        RTI.Function.DeclaringType.Name, ID);
                    break;
                    }

                    case Stage.ResolvedClass:
                    if (!get_method_address ())
                        throw new TargetException (TargetError.ClassNotInitialized,
                                       "Class `{0}' not initialized yet.",
                                       RTI.Function.DeclaringType.Name);
                    goto case Stage.HasMethodAddress;

                    case Stage.HasMethodAddress:
                    if (!get_virtual_method ())
                        return;
                    goto case Stage.HasVirtualMethod;

                    case Stage.HasVirtualMethod: {
                    Report.Debug (DebugFlags.SSE,
                              "{0} rti compiling method: {1}", sse, method);

                    stage = Stage.CompilingMethod;
                    inferior.CallMethod (
                        sse.MonoDebuggerInfo.CompileMethod, method.Address, 0, ID);
                    return;
                    }

                    case Stage.CompiledMethod: {
                    RTI.HasStarted = true;

                    sse.insert_temporary_breakpoint (invoke);

                    inferior.RuntimeInvoke (
                        sse.MonoDebuggerInfo.RuntimeInvoke,
                        method, instance, RTI.ParamObjects, ID, RTI.Debug);

                    stage = Stage.InvokedMethod;
                    return;
                    }

                    default:
                    throw new InternalError ();
                    }
                }