Mono.Debugger.Backend.Inferior.Run C# (CSharp) Method

Run() public method

public Run ( ) : int
return int
        public int Run()
        {
            if (has_target)
                throw new TargetException (TargetError.AlreadyHaveTarget);

            has_target = true;

            IntPtr error;

            string[] args = new string[start.CommandLineArguments.Length + 1];
            Array.Copy(start.CommandLineArguments, args, start.CommandLineArguments.Length);
            string[] env = new string[start.Environment.Length + 1];
            Array.Copy(start.Environment, env, start.Environment.Length);
            TargetError result = mono_debugger_server_spawn (
                server_handle, start.WorkingDirectory, args,
                env, start.RedirectOutput, out child_pid, out io_data, out error);
            if (result != TargetError.None) {
                string message = Marshal.PtrToStringAuto (error);
                g_free (error);

                throw new TargetException (
                    TargetError.CannotStartTarget, message);
            }

            if (start.RedirectOutput) {
                ST.Thread io_thread = new ST.Thread (new ST.ThreadStart (io_thread_main));
                io_thread.IsBackground = true;
                io_thread.Start ();
            }

            initialized = true;

            check_error (mono_debugger_server_initialize_process (server_handle));

            SetupInferior ();

            change_target_state (TargetState.Stopped, 0);

            return child_pid;
        }

Usage Example

Esempio n. 1
0
        public SingleSteppingEngine(ThreadManager manager, Process process,
					     ProcessStart start)
            : this(manager, process)
        {
            inferior = Inferior.CreateInferior (manager, process, start);

            if (start.PID != 0) {
                this.pid = start.PID;
                inferior.Attach (pid);
            } else {
                pid = inferior.Run ();
            }

            manager.AddEngine (this);
        }
Inferior