* 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
+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.
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");
}
}
public bool Valgrind {
get; set;
}
+
+ public ProcessLauncher CustomProcessLauncher {
+ get; set;
+ }
+
+ public delegate Process ProcessLauncher (ProcessStartInfo info);
}
public class VirtualMachineManager
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 ();