CreateDebuggingInterfaceFromVersion3 function

Accepts a common language runtime (CLR) version string that is returned from the CreateVersionStringFromModule function, and returns a corresponding debugger interface (typically, ICorDebug).

Syntax

HRESULT CreateDebuggingInterfaceFromVersion3 (
    [in] int iDebuggerVersion,
    [in] LPCWSTR szDebuggeeVersion,
    [in] LPCWSTR szApplicationGroupId,
    [in] ICLRDebuggingLibraryProvider3* pLibraryProvider,
    [out] IUnknown** ppCordb,
);

Parameters

iDebuggerVersion
[in] The version of interface the debugger expects.

szDebuggeeVersion
[in] Version string of the CLR in the target debuggee, which is returned by the CreateVersionStringFromModule function.

szApplicationGroupId
[in] A string representing the application group ID of a sandboxed process running in macOS. Pass NULL if the process is not running in a sandbox on macOS or on other platforms.

pLibraryProvider
[in] A callback interface instance for locating DBI and DAC. See ICLRDebuggingLibraryProvider3 interface.

ppCordb
[out] Pointer to a pointer to a COM object (IUnknown). This object will be cast to an ICorDebug object before it is returned.

Return value

S_OK
ppCordb references a valid object that implements the ICorDebug interface interface.

E_INVALIDARG
Either szDebuggeeVersion or ppCordb is null.

CORDBG_E_DEBUG_COMPONENT_MISSING
A component that is necessary for CLR debugging cannot be located. Either mscordbi.dll or mscordaccore.dll was not found in the same directory as the target CoreCLR.dll.

CORDBG_E_INCOMPATIBLE_PROTOCOL
Either mscordbi.dll or mscordaccore.dll is not the same version as the target CoreCLR.dll.

E_FAIL (or other E_ return codes)
Unable to return an ICorDebug interface.

Remarks

The interface that is returned provides the facilities for attaching to a CLR in a target process and debugging the managed code that the CLR is running.

Requirements

Platforms: See .NET supported operating systems.

Header: dbgshim.h

Library: dbgshim.dll, libdbgshim.so, libdbgshim.dylib

.NET Versions: Available since .NET 6.0