Beispiel #1
0
        /// <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));
        }
Beispiel #2
0
 public void SetEnableCustomNotification(CorClass cls, bool enable)
 {
     if (obj is ICorDebugProcess3 p3)
     {
         int hr = p3.SetEnableCustomNotification(cls.RawObject, enable ? 1 : 0);
     }
 }
Beispiel #3
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);
            }
        }
Beispiel #4
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()));
 }
Beispiel #5
0
        /// <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));
        }
Beispiel #6
0
 public CorValue CreateValue(CorElementType et, CorClass cls = null)
 {
     return(eval.CreateValue(et, cls));
 }
Beispiel #7
0
 public CorField(CorClass cls, uint token)
 {
     this.Class = cls;
     this.Token = token;
 }
Beispiel #8
0
 public bool Equals(CorClass other) => !ReferenceEquals(other, null) && RawObject == other.RawObject;
Beispiel #9
0
 public CorProperty(CorClass cls, uint token)
 {
     Class = cls;
     Token = token;
 }
Beispiel #10
0
 public CorField(CorClass cls, uint token)
 {
     Class = cls;
     Token = token;
 }
Beispiel #11
0
 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);
 }
Beispiel #12
0
        /// <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));
        }
Beispiel #13
0
 public CorProperty(CorClass cls, uint token)
 {
     this.Class = cls;
     this.Token = token;
 }
Beispiel #14
0
 /// <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));
 }
Beispiel #15
0
 public CorValue CreateValue(CorElementType et, CorClass cls = null) => eval.CreateValue(et, cls);
Beispiel #16
0
 /// <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));
 }
Beispiel #17
0
 public CorEvent(CorClass cls, uint token)
 {
     this.Class = cls;
     this.Token = token;
 }
Beispiel #18
0
 /// <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);
Beispiel #19
0
 public CorEvent(CorClass cls, uint token)
 {
     Class = cls;
     Token = token;
 }
Beispiel #20
0
 public bool Equals(CorClass other)
 {
     return(!ReferenceEquals(other, null) &&
            RawObject == other.RawObject);
 }