예제 #1
0
        /// <summary>
        /// Gets the value of the specified global variable.
        /// </summary>
        /// <param name="fieldDef">
        /// An <c>mdFieldDef</c> token that references the metadata
        /// describing the global variable.
        /// </param>
        /// <param name="value">The value of the specified global variable.</param>
        public int GetGlobalVariableValue(uint fieldDef, out CorDebugValue value)
        {
            void **pValue = default;
            int    result = Calli(_this, This[0]->GetGlobalVariableValue, fieldDef, &pValue);

            ComFactory.Create(pValue, out value);
            return(result);
        }
예제 #2
0
        /// <summary>
        /// Gets the value of the specified argument in this Microsoft intermediate
        /// language (MSIL) stack frame.
        /// </summary>
        /// <param name="dwIndex">
        /// The index of the argument in this MSIL stack frame.
        /// </param>
        /// <param name="value">
        /// A pointer to the address of an <c>ICorDebugValue</c> object that
        /// represents the retrieved value.
        /// </param>
        /// <remarks>
        /// The <c>GetArgument</c> method can be used either in an MSIL stack frame
        /// or in a just-in-time (JIT) compiled frame.
        /// </remarks>
        public int GetArgument(uint dwIndex, out CorDebugValue value)
        {
            void **pValue  = default;
            int    hResult = Calli(_this, This[0]->GetArgument, dwIndex, &pValue);

            ComFactory.Create(pValue, hResult, out value);
            return(hResult);
        }
예제 #3
0
        /// <summary>
        /// Gets the element at the given position, treating the array as
        /// a zero-based, single-dimensional array.
        /// </summary>
        /// <param name="position">
        /// The position of the element to be retrieved.
        /// </param>
        /// <param name="value">
        /// A pointer to the address of an <c>ICorDebugValue</c> object that
        /// represents the value of the element.
        /// </param>
        /// <remarks>
        /// The layout of a multi-dimension array follows the C++ style of
        /// array layout.
        /// </remarks>
        public int GetElementAtPosition(uint position, out CorDebugValue value)
        {
            void **pValue  = default;
            int    hResult = Calli(_this, This[0]->GetElementAtPosition, position, &pValue);

            ComFactory.Create(pValue, hResult, out value);
            return(hResult);
        }
예제 #4
0
        /// <summary>
        /// Gets a managed object from a COM callable wrapper (CCW) pointer.
        /// </summary>
        /// <param name="ccwPointer">
        /// A COM callable wrapper (CCW) pointer.
        /// </param>
        /// <param name="managedObject">
        /// A pointer to the address of an <c>ICorDebugValue</c> object that
        /// represents the managed object that corresponds to the given CCW pointer.
        /// </param>
        public int GetObjectForCCW(long ccwPointer, out CorDebugValue managedObject)
        {
            void **pManagedObject = default;
            int    hResult        = Calli(_this, This[0]->GetObjectForCCW, ccwPointer, &pManagedObject);

            ComFactory.Create(pManagedObject, hResult, out managedObject);
            return(hResult);
        }
예제 #5
0
        /// <summary>
        /// Gets the value of the specified static field.
        /// </summary>
        /// <param name="fieldDef">
        /// A FieldDef token that references the field to be retrieved.
        /// </param>
        /// <param name="frame">
        /// The frame to be used to disambiguate among thread, context, or application
        /// domain statics.
        ///
        /// If the static field is relative to a thread, a context, or an application domain,
        /// the frame will determine the proper value.
        /// </param>
        /// <param name="value">The value of the static field.</param>
        /// <remarks>
        /// For parameterized types, the value of a static field is relative to the particular
        /// instantiation. Therefore, if the class constructor takes parameters of type
        /// <see cref="Type" />, call <see cref="CorDebugType.GetStaticFieldValue" /> instead.
        /// </remarks>
        public int GetStaticFieldValue(uint fieldDef, CorDebugFrame frame, out CorDebugValue value)
        {
            using var pFrame = frame.AcquirePointer();
            void *pValue = default;
            int   result = Calli(_this, This[0]->GetStaticFieldValue, fieldDef, pFrame, &pValue);

            ComFactory.Create(pValue, out value);
            return(result);
        }
예제 #6
0
        /// <summary>
        /// Gets the value of the specified field of the specified class for this object value.
        /// </summary>
        /// <remarks>
        /// The class, specified in <see paramref="class" />, must be in
        /// the hierarchy of the object value's class, and the field must
        /// be a field of that class.
        ///
        /// This method will still succeed for generic objects and generic
        /// classes. For example, if <c>MyDictionary{V}</c> inherits from
        /// <c>Dictionary{string,V}</c>, and the object value is of type
        /// <c>MyDictionary{int32}</c>, passing the <see cref="CorDebugClass" />
        /// object for <c>Dictionary{K,V}</c> will successfully get a
        /// field of <c>Dictionary{string,int32}</c>.
        /// </remarks>
        public int GetFieldValue(CorDebugClass @class, uint fieldDef, out CorDebugValue value)
        {
            using var pClass = @class.AcquirePointer();
            void **pValue = default;
            int    result = Calli(_this, This[0]->GetFieldValue, pClass, fieldDef, &pValue);

            ComFactory.Create(pValue, out value);
            return(result);
        }
예제 #7
0
        /// <summary>
        /// Gets the value of the given array element.
        /// </summary>
        /// <param name="indices">
        /// An array of index values, each of which specifies a position within a dimension
        /// of the <c>ICorDebugArrayValue</c> object.
        ///
        /// This value must not be null.
        /// </param>
        /// <param name="value">
        /// A pointer to the address of an <c>ICorDebugValue</c> object that represents
        /// the value of the specified element.
        /// </param>
        public int GetElement(Span <uint> indices, out CorDebugValue value)
        {
            void **pValue = default;

            fixed(void *pIndices = indices)
            {
                int hResult = Calli(_this, This[0]->GetElement, indices.Length, pIndices, &pValue);

                ComFactory.Create(pValue, hResult, out value);
                return(hResult);
            }
        }
예제 #8
0
 /// <summary>
 /// Gets a <see cref="CorDebugValue" /> representing the common
 /// language runtime (CLR) thread.
 /// </summary>
 public int GetObject(out CorDebugValue @object) => InvokeGetObject(_this, This[0]->GetObject, out @object);
예제 #9
0
 /// <summary>
 /// Gets the exception that is currently being thrown by
 /// managed code.
 /// </summary>
 /// <remarks>
 /// The exception object will exist from the time the exception
 /// is thrown until the end of the catch block. A function
 /// evaluation, which is performed by the <see cref="CorDebugEval" />
 /// methods, will clear out the exception object on setup and
 /// restore it on completion.
 ///
 /// Exceptions can be nested (for example, if an exception is
 /// thrown in a filter or in a function evaluation), so there
 /// may be multiple outstanding exceptions on a single thread.
 /// This method returns the most current exception.
 ///
 /// The exception object and type may change throughout the
 /// life of the exception. For example, after an exception of
 /// type x is thrown, the common language runtime (CLR) may
 /// run out of memory and promote it to an out-of-memory
 /// exception.
 /// </remarks>
 public int GetCurrentException(out CorDebugValue exceptionObject)
 => InvokeGetObject(_this, This[0]->GetCurrentException, out exceptionObject);
 /// <summary>
 /// Gets the value of the object on which the breakpoint is set.
 /// </summary>
 public int GetValue(out CorDebugValue value) => InvokeGetObject(_this, This[0]->GetValue, out value);
 public int DereferenceStrong(out CorDebugValue pValue) => InvokeGetObject(_this, This[0]->DereferenceStrong, out pValue);
예제 #12
0
        public int CreateValue(CorElementType elementType, CorDebugClass elementClass, out CorDebugValue value)
        {
            using var pElementClass = elementClass.AcquirePointer();
            void *pValue = default;
            int   result = Calli(_this, This[0]->CreateValue, (int)elementType, pElementClass, &pValue);

            ComFactory.Create(pValue, out value);
            return(result);
        }
예제 #13
0
 /// <summary>
 /// Gets the results of this evaluation.
 /// </summary>
 /// <param name="result"></param>
 /// <returns></returns>
 /// <remarks>
 /// This method is valid only after the evaluation is completed.
 ///
 /// If the evaluation completes normally, <see paramref="result" /> specifies the
 /// results. If it terminates with an exception, the result is the exception thrown.
 /// If the evaluation was for a new object, the result is the reference to the new object.
 /// </remarks>
 public int GetResult(out CorDebugValue result) => InvokeGetObject(_this, This[0]->GetResult, out result);