2 using System.Collections.Generic;
4 namespace Mono.Debugger.Soft
7 * Represents a valuetype value in the debuggee
9 public class StructMirror : Value {
14 internal StructMirror (VirtualMachine vm, TypeMirror type, Value[] fields) : base (vm, 0) {
19 public TypeMirror Type {
25 public Value[] Fields {
31 public Value this [String field] {
33 FieldInfoMirror[] field_info = Type.GetFields ();
35 for (int i = 0; i < field_info.Length; ++i) {
36 if (!field_info [i].IsStatic) {
37 if (field_info [i].Name == field)
42 throw new ArgumentException ("Unknown struct field '" + field + "'.", "field");
45 FieldInfoMirror[] field_info = Type.GetFields ();
47 for (int i = 0; i < field_info.Length; ++i) {
48 if (!field_info [i].IsStatic) {
49 if (field_info [i].Name == field) {
56 throw new ArgumentException ("Unknown struct field '" + field + "'.", "field");
60 internal void SetField (int index, Value value) {
61 fields [index] = value;
64 public Value InvokeMethod (ThreadMirror thread, MethodMirror method, IList<Value> arguments) {
65 return ObjectMirror.InvokeMethod (vm, thread, method, this, arguments, InvokeOptions.None);
68 public Value InvokeMethod (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options) {
69 return ObjectMirror.InvokeMethod (vm, thread, method, this, arguments, options);
72 [Obsolete ("Use the overload without the 'vm' argument")]
73 public IAsyncResult BeginInvokeMethod (VirtualMachine vm, ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options, AsyncCallback callback, object state) {
74 return ObjectMirror.BeginInvokeMethod (vm, thread, method, this, arguments, options, callback, state);
77 public IAsyncResult BeginInvokeMethod (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options, AsyncCallback callback, object state) {
78 return ObjectMirror.BeginInvokeMethod (vm, thread, method, this, arguments, options, callback, state);
81 public Value EndInvokeMethod (IAsyncResult asyncResult) {
82 return ObjectMirror.EndInvokeMethodInternal (asyncResult);