/// <summary> /// Creates a value of the specified type with an initial value of 0 or null /// </summary> /// <param name="et">Element type</param> /// <param name="cls">Type or null if it's not a Class/ValueType</param> /// <returns></returns> public CorValue CreateValue(CorElementType et, CorClass cls = null) { ICorDebugValue value; int hr = obj.CreateValue(et, cls?.RawObject, out value); return(hr < 0 || value == null ? null : new CorValue(value)); }
public void SetEnableCustomNotification(CorClass cls, bool enable) { if (obj is ICorDebugProcess3 p3) { int hr = p3.SetEnableCustomNotification(cls.RawObject, enable ? 1 : 0); } }
public void SetEnableCustomNotification(CorClass cls, bool enable) { var p3 = obj as ICorDebugProcess3; if (p3 != null) { int hr = p3.SetEnableCustomNotification(cls.RawObject, enable ? 1 : 0); } }
/// <summary> /// Instantiates a new parameterized type object of the specified class without attempting to call a constructor method /// </summary> /// <param name="cls">Class</param> /// <param name="typeArgs">Type args or null if none required</param> /// <returns></returns> public int NewParameterizedObjectNoConstructor(CorClass cls, CorType[] typeArgs) { if (eval2 == null) { if (typeArgs == null || typeArgs.Length == 0) { return(NewObjectNoConstructor(cls)); } return(-1); } return(eval2.NewParameterizedObjectNoConstructor(cls.RawObject, typeArgs == null ? 0 : typeArgs.Length, typeArgs.ToCorDebugArray())); }
/// <summary> /// Gets the value of a field or null if it's not a <see cref="ICorDebugObjectValue"/> /// </summary> /// <param name="cls">Class</param> /// <param name="token">Token of field in <paramref name="cls"/></param> /// <param name="hr">Updated with HRESULT</param> /// <returns></returns> public CorValue GetFieldValue(CorClass cls, uint token, out int hr) { var o = obj as ICorDebugObjectValue; if (o == null || cls == null) { hr = -1; return(null); } hr = o.GetFieldValue(cls.RawObject, token, out var value); return(hr < 0 || value == null ? null : new CorValue(value)); }
public CorValue CreateValue(CorElementType et, CorClass cls = null) { return(eval.CreateValue(et, cls)); }
public CorField(CorClass cls, uint token) { this.Class = cls; this.Token = token; }
public bool Equals(CorClass other) => !ReferenceEquals(other, null) && RawObject == other.RawObject;
public CorProperty(CorClass cls, uint token) { Class = cls; Token = token; }
public CorField(CorClass cls, uint token) { Class = cls; Token = token; }
public T WriteType <T>(T output, CorClass cls, TypePrinterFlags flags, Func <DnEval> getEval = null) where T : ITypeOutput { new TypePrinter(output, flags, getEval).Write(cls); return(output); }
/// <summary> /// Gets the value of a field or null if it's not a <see cref="ICorDebugObjectValue"/> /// </summary> /// <param name="cls">Class</param> /// <param name="token">Token of field in <paramref name="cls"/></param> /// <returns></returns> public CorValue GetFieldValue(CorClass cls, uint token) { int hr; return(GetFieldValue(cls, token, out hr)); }
public CorProperty(CorClass cls, uint token) { this.Class = cls; this.Token = token; }
/// <summary> /// Allocates a new array of the specified element type and dimensions /// </summary> /// <param name="et">Element type</param> /// <param name="cls">Class or null if not needed</param> /// <param name="dims">Dimensions</param> /// <param name="lowBounds">Lower bounds or null (ignored by the CLR debugger at the moment)</param> /// <returns></returns> public int NewArray(CorElementType et, CorClass cls, uint[] dims, int[] lowBounds = null) { Debug.Assert(dims != null && (lowBounds == null || lowBounds.Length == dims.Length)); return(obj.NewArray(et, cls?.RawObject, dims.Length, dims, lowBounds)); }
public CorValue CreateValue(CorElementType et, CorClass cls = null) => eval.CreateValue(et, cls);
/// <summary> /// Allocates a new object instance of the specified type, without attempting to call a constructor method /// </summary> /// <param name="cls">Class</param> /// <returns></returns> public int NewObjectNoConstructor(CorClass cls) { // Same thing as calling NewParameterizedObjectNoConstructor(cls, null) return(obj.NewObjectNoConstructor(cls.RawObject)); }
public CorEvent(CorClass cls, uint token) { this.Class = cls; this.Token = token; }
/// <summary> /// Gets the value of a field or null if it's not a <see cref="ICorDebugObjectValue"/> /// </summary> /// <param name="cls">Class</param> /// <param name="token">Token of field in <paramref name="cls"/></param> /// <returns></returns> public CorValue GetFieldValue(CorClass cls, uint token) => GetFieldValue(cls, token, out int hr);
public CorEvent(CorClass cls, uint token) { Class = cls; Token = token; }
public bool Equals(CorClass other) { return(!ReferenceEquals(other, null) && RawObject == other.RawObject); }