Repository navigation
dbgshim: route live debugging through cDAC-capable DBI first - #5940
Merged
Merged
Conversation
- Add a SetCDacLoadPolicy export and process-wide setting lets the live-debugging connection APIs select the cDAC/legacy DAC policy. - Call into the bundled DBI to check whether using cDAC with it suceeded. Each path invokes the DBI with the cDAC first and falls back to the legacy provider/side-by-side path. - Use simple unified helper to ensure cdac errors prevail over non-cdac ones in fallback scenario. - Add SetCDacLoadPolicy test wrapper plus live policy tests for the version3 and RegisterForRuntimeStartup3 paths asserting the cDAC/legacy gating and provider fallback paths.
Contributor
There was a problem hiding this comment.
Pull request overview
Routes dbgshim’s live debugging activation paths through a cDAC-capable DBI first, controlled by a new process-wide cDAC load policy export, with unit tests validating policy gating and fallback behavior.
Changes:
- Add
SetCDacLoadPolicydbgshim export + policy enum, and plumb policy into live-debugging creation APIs. - Attempt activation via bundled DBI+cDAC first, then fall back to library-provider/side-by-side legacy activation with unified HRESULT selection.
- Add managed test wrapper + new unit tests covering policy behavior for
CreateDebuggingInterfaceFromVersion3andRegisterForRuntimeStartup3.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/DbgShim.UnitTests/DbgShimTests.cs | Adds live policy test matrix and end-to-end tests for Version3 + RuntimeStartup3 policy gating and fallback behavior. |
| src/tests/DbgShim.UnitTests/DbgShimAPI.cs | Adds managed delegate binding and wrapper for SetCDacLoadPolicy export. |
| src/dbgshim/debugshim.h | Moves CDacLoadPolicy to shared header and exposes helpers for bundled cDAC+DBI resolution and activation-result selection. |
| src/dbgshim/debugshim.cpp | Implements bundled cDAC+DBI path resolution helper and shares activation-result selection logic. |
| src/dbgshim/dbgshim.h | Adds include guards, defines CDacLoadPolicy, and declares SetCDacLoadPolicy export. |
| src/dbgshim/dbgshim.cpp | Implements process-wide policy and routes live-debugging creation paths through cDAC-first activation with fallback logic. |
| src/dbgshim/dbgshim.ntdef | Exports SetCDacLoadPolicy on Windows. |
| src/dbgshim/dbgshim_unixexports.src | Exports SetCDacLoadPolicy on Unix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
noahfalk
approved these changes
Jul 24, 2026
Co-authored-by: Noah Falk <[email protected]>
hoyosjs
commented
Jul 25, 2026
hoyosjs
commented
Jul 25, 2026
Co-authored-by: Juan Hoyos <[email protected]>
rcj1
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
path.
gating and provider fallback paths.