Repository navigation
SOS: load DBI through dbgshim - #5980
Conversation
5d53e54 to
3e724e8
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates SOS’s DBI activation path so CoreCLR ICorDebugProcess creation is routed through dbgshim (preferring the bundled universal DBI + cDAC first), while keeping the existing direct mscordbi activation path for Desktop CLR. It also updates managed hosting to use the same dbgshim-based activation and packages the universal DBI alongside existing SOS assets.
Changes:
- Native SOS: add dbgshim-based
ICorDebugProcessactivation (CoreCLR) and factor Desktop CLR activation into a dedicated helper. - SOS.Hosting: introduce a managed
ICLRDebuggingLibraryProvider2implementation and route CorDebug activation through a newIClrDataProcessActivator.CreateCorDebugProcessAPI. - Packaging: include
mscordbi_universalin the shared SOS packaging (gated byPackageWithCDac).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/SOS/Strike/platform/runtimeimpl.h | Adds CreateDesktopCorDebugProcess declaration to separate Desktop CLR activation path. |
| src/SOS/Strike/platform/runtimeimpl.cpp | Implements Desktop CLR DBI activation helper and routes CoreCLR DBI activation through dbgshim + library provider. |
| src/SOS/SOS.Hosting/RuntimeWrapper.cs | Updates managed DBI activation to use IClrDataProcessActivator for CoreCLR and improves HRESULT propagation. |
| src/SOS/SOS.Hosting/RuntimeLibraryProvider.cs | Adds managed ICLRDebuggingLibraryProvider2 implementation to resolve DBI/DAC paths for dbgshim. |
| src/SOS/SOS.Hosting/ClrDataProcessActivator.cs | Refactors dbgshim initialization and adds CreateCorDebugProcess to activate ICorDebugProcess via dbgshim. |
| src/sos-packaging.props | Packages mscordbi_universal for supported RIDs when PackageWithCDac is enabled. |
| src/Microsoft.Diagnostics.DebugServices/IClrDataProcessActivator.cs | Extends the activator interface with a new CorDebug activation API. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
noahfalk
left a comment
There was a problem hiding this comment.
LGTM modulo the policy handling
Teach dbgshim to recognize Desktop CLR through the standard ICLRDebugging path and apply the configured cDAC policy consistently to data access and DBI activation. Verify provider-resolved DAC and DBI binaries with WinTrust, Microsoft root policy, and the .NET DAC OID before loading them. Keep bundled universal DBI on the tool-asset trust path, preserve DAC-before-DBI ordering, and contain provider callback failures.
noahfalk
left a comment
There was a problem hiding this comment.
Still a couple of nit suggestions waiting to be resolved, but LGTM!
Co-authored-by: Noah Falk <[email protected]> Co-authored-by: Juan Hoyos <[email protected]>
|
/ba-g prior commit was green except for know failures in the new SOS harness. |
Depends on #5966.
Route CoreCLR
ICorDebugProcessactivation through dbgshim so the bundled universal DBI and cDAC are tried first, with SOS's existing DAC/DBI resolver retained as the provider fallback. Keep desktop CLR on its existing directmscordbipath because the public dbgshim factory is CoreCLR-SKU-specific.Ship
mscordbi_universalfrom the cDAC transport package beside dbgshim andmscordaccore_universalin the shared SOS packaging used by dotnet-sos, dotnet-dump, and the WinDbg SOS package.Validation:
clrstack -iwith forced cDAC used the bundled DBIclrstack -iused the matching runtime DAC/DBI