2009-12-05 Lluis Sanchez <lluis@novell.com>
authorLluis Sanchez <lluis@novell.com>
Sat, 5 Dec 2009 00:57:00 +0000 (00:57 -0000)
committerLluis Sanchez <lluis@novell.com>
Sat, 5 Dec 2009 00:57:00 +0000 (00:57 -0000)
* StructMirror.cs: Fix field indexer for structs with static fields.
* VirtualMachineManager.cs: Added an option to LaunchOptions which
allows providing a custom method for launching the process. This
allows launching mono in a wrapper process.

svn path=/trunk/mcs/; revision=147729

mcs/class/Mono.Debugger.Soft/Mono.Debugger/ChangeLog
mcs/class/Mono.Debugger.Soft/Mono.Debugger/StructMirror.cs
mcs/class/Mono.Debugger.Soft/Mono.Debugger/VirtualMachineManager.cs

index 341b15596122e9b95373612b520fb705c54c3a7f..ea04efdc5ed2ca01937c38e7bb45f8ad1a999319 100644 (file)
@@ -1,3 +1,10 @@
+2009-12-05  Lluis Sanchez  <lluis@novell.com>
+
+       * StructMirror.cs: Fix field indexer for structs with static fields.
+       * VirtualMachineManager.cs: Added an option to LaunchOptions which
+       allows providing a custom method for launching the process. This
+       allows launching mono in a wrapper process.
+
 2009-12-03  Zoltan Varga  <vargaz@gmail.com>
 
        * StructMirror.cs (this): Ignore static fields.
index 817cf85988542b65c5c87840cbe0fbbfbd373dbd..1b8ea13a1498ad2d4e38091a529cf8e07c06fc83 100644 (file)
@@ -31,9 +31,14 @@ namespace Mono.Debugger
                public Value this [String field] {
                        get {
                                FieldInfoMirror[] field_info = Type.GetFields ();
-                               for (int i = 0; i < field_info.Length; ++i)
-                                       if (!field_info [i].IsStatic && field_info [i].Name == field)
-                                               return Fields [i];
+                               int nf = 0;
+                               for (int i = 0; i < field_info.Length; ++i) {
+                                       if (!field_info [i].IsStatic) {
+                                               if (field_info [i].Name == field)
+                                                       return Fields [nf];
+                                               nf++;
+                                       }
+                               }
                                throw new ArgumentException ("Unknown struct field '" + field + "'.", "field");
                        }
                }
index 6545cd0f6b98e80ae0e7ddd2ffdbe59a4b829e9c..7ec5b1dcc236bfc761b2012a7b924daa0ef2c8ad 100644 (file)
@@ -16,6 +16,12 @@ namespace Mono.Debugger
                public bool Valgrind {
                        get; set;
                }
+               
+               public ProcessLauncher CustomProcessLauncher {
+                       get; set;
+               }
+
+               public delegate Process ProcessLauncher (ProcessStartInfo info);
        }
 
        public class VirtualMachineManager
@@ -71,7 +77,11 @@ namespace Mono.Debugger
                        if (options != null && options.Valgrind)
                                info.FileName = "valgrind";
                                
-                       Process p = Process.Start (info);
+                       Process p;
+                       if (options != null && options.CustomProcessLauncher != null)
+                               p = options.CustomProcessLauncher (info);
+                       else
+                               p = Process.Start (info);
                        
                        p.Exited += delegate (object sender, EventArgs eargs) {
                                socket.Close ();