internal unsafe Enumerator(CorDebugComEnum <TUnknown> parent)
            {
                int hResult = parent.Clone(out _parent);

                _ownsParent = hResult != HResult.E_NOTIMPL;
                if (_ownsParent)
                {
                    hResult.MaybeThrowHr();
                }
                else
                {
                    _parent = parent;
                }

                _ptr = default;
            }
Beispiel #2
0
        /// <summary>
        /// Gets an enumerator for cached Windows Runtime types in an application
        /// domain based on their interface identifiers.
        /// </summary>
        /// <param name="cReqTypes">
        /// The number of required types.
        /// </param>
        /// <param name="iidsToResolve">
        /// A pointer to an array that contains the interface identifiers
        /// corresponding to the managed representations of the Windows Runtime
        /// types to be retrieved.
        /// </param>
        /// <param name="typesEnum">
        /// A pointer to the address of an <c>ICorDebugTypeEnum</c> interface object
        /// that allows enumeration of the cached managed representations of the
        /// Windows Runtime types retrieved, based on the interface identifiers in
        /// <c>iidsToResolve</c>.
        /// </param>
        /// <remarks>
        /// If the method fails to retrieve information for a specific interface
        /// identifier, the corresponding entry in the <c>ICorDebugTypeEnum</c>
        /// collection will have a type of <c>ELEMENT_TYPE_END</c> for errors due
        /// to data retrieval issues, or <c>ELEMENT_TYPE_VOID</c> for unknown
        /// interface identifiers.
        /// </remarks>
        public int GetCachedWinRTTypesForIIDs(
            Span <Guid> iidsToResolve,
            out CorDebugComEnum <CorDebugType> typesEnum)
        {
            void **pTypesEnum = default;

            fixed(void *piidsToResolve = iidsToResolve)
            {
                int hResult = Calli(
                    _this,
                    This[0]->GetCachedWinRTTypesForIIDs,
                    iidsToResolve.Length,
                    piidsToResolve,
                    &pTypesEnum);

                ComFactory.Create(pTypesEnum, hResult, out typesEnum);
                return(hResult);
            }
        }
 /// <summary>
 /// Gets an enumerator to the local variables and arguments in
 /// a function.
 /// </summary>
 /// <param name="enum">
 /// A pointer to the address of an <c>ICorDebugVariableHomeEnum</c>
 /// interface object that is an enumerator for the local variables
 /// and arguments in a function.
 /// </param>
 /// <remarks>
 /// The <c>ICorDebugVariableHomeEnum</c> interface object is a standard
 /// enumerator derived from the <c>ICorDebugEnum</c> interface that allows
 /// you to enumerate <c>ICorDebugVariableHome</c> objects. The collection
 /// may include multiple <c>ICorDebugVariableHome</c> objects for the same
 /// slot or argument index if they have different homes at different points
 /// in the function.
 /// </remarks>
 public int EnumerateVariableHomes(out CorDebugComEnum <CorDebugVariableHome> @enum)
 => InvokeGetObject(_this, This[0]->EnumerateVariableHomes, out @enum);
 /// <summary>
 /// Gets an enumerator for the local variables in this frame.
 /// </summary>
 /// <param name="valueEnum">
 /// A pointer to the address of an <c>ICorDebugValueEnum</c> object that
 /// is the enumerator for the local variables in this frame.
 /// </param>
 /// <remarks>
 /// <c>EnumerateLocalVariables</c> gets an enumerator that can list the
 /// local variables available in the call frame that is represented by
 /// this <c>ICorDebugILFrame</c> object. The list may not include all
 /// of the local variables in the running function, because some of
 /// them may not be active.
 /// </remarks>
 public int EnumerateLocalVariables(out CorDebugComEnum <CorDebugValue> valueEnum)
 => InvokeGetObject(_this, This[0]->EnumerateLocalVariables, out valueEnum);
 /// <summary>
 /// Gets an enumerator for the arguments in this frame.
 /// </summary>
 /// <param name="valueEnum">
 /// A pointer to the address of an <c>ICorDebugValueEnum</c> object that
 /// is the enumerator for the arguments in this frame.
 /// </param>
 /// <remarks>
 /// <c>EnumerateArguments</c> gets an enumerator that can list the
 /// arguments available in the call frame that is represented by this
 /// <c>ICorDebugILFrame</c> object. The list will include arguments
 /// that are vararg (that is, a variable number of arguments) as well
 /// as arguments that are not <c>vararg</c>.
 /// </remarks>
 public int EnumerateArguments(out CorDebugComEnum <CorDebugValue> valueEnum)
 => InvokeGetObject(_this, This[0]->EnumerateArguments, out valueEnum);
Beispiel #6
0
 /// <summary>
 /// Gets an enumerator that contains all the managed stack frames in the chain,
 /// starting with the most recent frame.
 /// </summary>
 /// <remarks>
 /// The chain represents the physical call stack for the thread.
 ///
 /// This method should be called only for managed chains. The debugging API does not
 /// provide methods for obtaining frames contained in unmanaged chains. The debugger
 /// must use other means to obtain this information.
 /// </remarks>
 public int EnumerateFrames(out CorDebugComEnum <CorDebugFrame> frames)
 => InvokeGetObject(_this, This[0]->EnumerateFrames, out frames);
Beispiel #7
0
 /// <summary>
 /// Gets the modules contained in this instance.
 /// </summary>
 public int EnumerateModules(out CorDebugComEnum <CorDebugModule> modules)
 => InvokeGetObject(_this, This[0]->EnumerateModules, out modules);
 /// <summary>
 /// Gets an enumerator for the active managed threads in the process.
 /// </summary>
 /// <remarks>
 /// A thread is considered active after the <c>ICorDebugManagedCallback::CreateThread</c>
 /// callback has been dispatched and before the <c>ICorDebugManagedCallback::ExitThread</c>
 /// callback has been dispatched. A managed thread may not necessarily have any managed
 /// frames on its stack. Threads can be enumerated even before the <c>ICorDebugManagedCallback::CreateProcess</c>
 /// callback. The enumeration will naturally be empty.
 /// </remarks>
 public int EnumerateThreads(out CorDebugComEnum <CorDebugThread> threads)
 => InvokeGetObject(_this, This[0]->EnumerateThreads, out threads);
Beispiel #9
0
 public int EnumerateNativeCode(out CorDebugComEnum <CorDebugCode> pCodeEnum)
 => InvokeGetObject(_this, This[0]->EnumerateNativeCode, out pCodeEnum);
 /// <summary>
 /// Gets all of the stack chains in this thread.
 /// </summary>
 /// <param name="chains">
 /// An enumerable containing all of the stack chains in this
 /// thread, starting at the active (most recent) chain.
 /// </param>
 /// <returns></returns>
 /// <remarks>
 /// The stack chain represents the physical call stack for
 /// the thread. The following circumstances create a stack
 /// chain boundary:
 ///
 /// - A managed-to-unmanaged or unmanaged-to-managed transition.
 /// - A context switch.
 /// - A debugger hijacking of a user thread.
 ///
 /// In the simple case for a thread that is running purely
 /// managed code in a single context, a one-to-one correspondence
 /// will exist between threads and stack chains.
 ///
 /// A debugger may want to rearrange the physical call stacks of
 /// all threads into logical call stacks. This would involve sorting
 /// all the threads' chains by their caller/callee relationships and
 /// regrouping them.
 /// </remarks>
 public int EnumerateChains(out CorDebugComEnum <CorDebugChain> chains)
 => InvokeGetObject(_this, This[0]->EnumerateChains, out chains);
 /// <summary>
 /// Gets all active steppers in the application domain.
 /// </summary>
 public int EnumerateSteppers(out CorDebugComEnum <CorDebugStepper> steppers)
 => InvokeGetObject(_this, This[0]->EnumerateSteppers, out steppers);
 /// <summary>
 /// Gets all active breakpoints in the application domain.
 /// </summary>
 public int EnumerateBreakpoints(out CorDebugComEnum <CorDebugBreakpoint> breakpoints)
 => InvokeGetObject(_this, This[0]->EnumerateBreakpoints, out breakpoints);
 /// <summary>
 /// Gets all of the assemblies in the application domain.
 /// </summary>
 public int EnumerateAssemblies(out CorDebugComEnum <CorDebugAssembly> assemblies)
 => InvokeGetObject(_this, This[0]->EnumerateAssemblies, out assemblies);
Beispiel #14
0
 /// <summary>
 /// Provides an ordered list of threads that are queued on the event
 /// that is associated with a monitor lock.
 /// </summary>
 /// <param name="threadEnum">
 /// The <c>ICorDebugThreadEnum</c> enumerator that provides the ordered
 /// list of threads.
 /// </param>
 /// <returns>
 /// This method returns the following specific HRESULTs as well as
 /// HRESULT errors that indicate method failure.
 ///
 /// - <c>S_OK</c>: The list is not empty.
 ///
 /// - <c>S_FALSE</c>: The list is empty.
 /// </returns>
 /// <remarks>
 /// The first thread in the list is the first thread that is released by the
 /// next call to <c>System.Threading.Monitor.Pulse(System.Object)</c>. The
 /// next thread in the list is released on the following call, and so on.
 ///
 /// If the list is not empty, this method returns <c>S_OK</c>. If the list is
 /// empty, the method returns <c>S_FALSE</c>; in this case, the enumeration is
 /// still valid, although it is empty.
 ///
 /// In either case, the enumeration interface is usable only for the duration
 /// of the current synchronized state. However, the thread's interfaces
 /// dispensed from it are valid until the thread exits.
 ///
 /// If <see paramref="ppThreadEnum" /> is not a valid pointer, the result is
 /// undefined.
 ///
 /// If an error occurs such that it cannot be determined which, if any, threads
 /// are waiting for the monitor, the method returns an HRESULT that indicates
 /// failure.
 /// </remarks>
 public int GetMonitorEventWaitList(out CorDebugComEnum <CorDebugThread> threadEnum)
 => InvokeGetObject(_this, This[0]->GetMonitorEventWaitList, out threadEnum);
Beispiel #15
0
 /// <summary>
 /// Enumerates all the application domains in this process.
 /// </summary>
 /// <remarks>
 /// This method can be used before the <c>ICorDebugManagedCallback::CreateProcess</c>
 /// callback.
 /// </remarks>
 public int EnumerateAppDomains(out CorDebugComEnum <CorDebugAppDomain> appDomains)
 => InvokeGetObject(_this, This[0]->EnumerateAppDomains, out appDomains);
 /// <summary>
 /// Gets the Type parameters of the class referenced by this type.
 /// </summary>
 /// <remarks>
 /// You can use this method if the <see cref="GetType(out CorElementType)" /> is
 /// any of the following:
 ///
 /// - <see cref="CorElementType.ELEMENT_TYPE_CLASS" />
 /// - <see cref="CorElementType.ELEMENT_TYPE_VALUETYPE" />
 /// - <see cref="CorElementType.ELEMENT_TYPE_ARRAY" />
 /// - <see cref="CorElementType.ELEMENT_TYPE_SZARRAY" />
 /// - <see cref="CorElementType.ELEMENT_TYPE_BYREF" />
 /// - <see cref="CorElementType.ELEMENT_TYPE_PTR" />
 /// - <see cref="CorElementType.ELEMENT_TYPE_FNPTR" />
 ///
 /// The number of parameters and their order depends on the type:
 ///
 /// - <see cref="CorElementType.ELEMENT_TYPE_CLASS" /> or <see cref="CorElementType.ELEMENT_TYPE_VALUETYPE" />:
 ///   The number of type parameters contained will depend on the number
 ///   of formal type parameters for the corresponding class. For example,
 ///   if the type is class Dict{String,int32}, then EnumerateTypeParameters
 ///   will return an enumerable that contains objects representing String and
 ///   int32 in sequence.
 ///
 /// - <see cref="CorElementType.ELEMENT_TYPE_FNPTR" />: The number of
 /// type parameters contained will be one greater than the number of arguments
 /// accepted by the function. The first type parameter contained in the enumerable
 /// is the return type for the function, and the subsequent type parameters are
 /// the function's parameters.
 ///
 /// - <see cref="CorElementType.ELEMENT_TYPE_ARRAY" />,
 ///   <see cref="CorElementType.ELEMENT_TYPE_SZARRAY" />,
 ///   <see cref="CorElementType.ELEMENT_TYPE_BYREFARRAY" />,
 ///   <see cref="CorElementType.ELEMENT_TYPE_PTR" />: One type parameter will be
 ///   returned. For example, if the type is an array type such as int32[],
 ///   then this method will return an enumerable that contains an object
 ///   representing int32.
 /// </remarks>
 public int EnumerateTypeParameters(out CorDebugComEnum <CorDebugType> tyParEnum)
 => InvokeGetObject(_this, This[0]->EnumerateTypeParameters, out tyParEnum);