public static TypeMirror GetType(TypeValue parent, int key) { return null; // we don't have enough info to return a decent type }
public static VariableItem GetChild(ThreadMirror thread, VariableItem parentItem, TypeValue parent, int index) { return parent.GetChild(thread, parentItem, index); }
public static VariableItem GetChild(ThreadMirror thread, VariableItem parentItem, LiveStackFrame parent, int index) { VariableItem child; IList<LocalVariable> locals = parent.GetVisibleVariables(); if (index < locals.Count) { LocalVariable local = locals[index]; string name = local.Name; if (string.IsNullOrEmpty(name)) name = "$" + local.Index; // temporary variable Value v = parent.GetValue(local); child = new VariableItem(thread, name, parentItem, local, v, index); } else { FieldInfoMirror[] fields = parent.Method.DeclaringType.GetAllFields().ToArray(); Contract.Assert(fields.Length > 0); object v = null; string name = "this"; if (parent.ThisPtr is ObjectMirror) { v = new InstanceValue((ObjectMirror) parent.ThisPtr, fields); } else if (parent.ThisPtr is StructMirror) { v = new InstanceValue((StructMirror) parent.ThisPtr, fields); } else if (parent.ThisPtr == null || parent.ThisPtr.IsNull()) { v = new TypeValue(parent.Method.DeclaringType); name = "statics"; } else { Contract.Assert(false, parent.ThisPtr.TypeName() + " is bogus"); } child = new VariableItem(thread, name, parentItem, index, v, index); } return child; }
public static void Set(ThreadMirror thread, VariableItem item, TypeValue parent, int key, Value newValue) { FieldInfoMirror field = parent.Type.GetFields()[key]; Contract.Assert(field.IsStatic); parent.Type.SetValue(field, newValue); }