New tests.
[mono.git] / mcs / class / Mono.Debugger.Soft / Mono.Debugger.Soft / VirtualMachineManager.cs
index 932963473e6d0d2adc381281263c3aa84bc99cb5..17b9032fc2598d16a90e82f1407e1cd92c838e82 100644 (file)
@@ -21,18 +21,18 @@ namespace Mono.Debugger.Soft
                        get; set;
                }
 
-               public delegate Process ProcessLauncher (ProcessStartInfo info);
+               public delegate IProcess ProcessLauncher (ProcessStartInfo info);
        }
 
        public class VirtualMachineManager
        {
-               private delegate VirtualMachine LaunchCallback (Process p, Socket socket);
+               private delegate VirtualMachine LaunchCallback (IProcess p, ProcessStartInfo info, Socket socket);
                private delegate VirtualMachine ListenCallback (Socket dbg_sock, Socket con_sock); 
 
                internal VirtualMachineManager () {
                }
 
-               public static VirtualMachine LaunchInternal (Process p, Socket socket) {
+               public static VirtualMachine LaunchInternal (IProcess p, ProcessStartInfo info, Socket socket) {
                        Socket accepted = null;
                        try {
                                accepted = socket.Accept ();
@@ -44,10 +44,10 @@ namespace Mono.Debugger.Soft
 
                        VirtualMachine vm = new VirtualMachine (p, conn);
 
-                       if (p.StartInfo.RedirectStandardOutput)
+                       if (info.RedirectStandardOutput)
                                vm.StandardOutput = p.StandardOutput;
                        
-                       if (p.StartInfo.RedirectStandardError)
+                       if (info.RedirectStandardError)
                                vm.StandardError = p.StandardError;
 
                        conn.EventHandler = new EventHandler (vm);
@@ -77,18 +77,18 @@ namespace Mono.Debugger.Soft
                        if (options != null && options.Valgrind)
                                info.FileName = "valgrind";
                                
-                       Process p;
+                       IProcess p;
                        if (options != null && options.CustomProcessLauncher != null)
                                p = options.CustomProcessLauncher (info);
                        else
-                               p = Process.Start (info);
+                               p = new ProcessWrapper (Process.Start (info));
                        
                        p.Exited += delegate (object sender, EventArgs eargs) {
                                socket.Close ();
                        };
 
                        LaunchCallback c = new LaunchCallback (LaunchInternal);
-                       return c.BeginInvoke (p, socket, callback, socket);
+                       return c.BeginInvoke (p, info, socket, callback, socket);
                }
 
                public static VirtualMachine EndLaunch (IAsyncResult asyncResult) {