Skip to content

dbgshim: route live debugging through cDAC-capable DBI first - #5940

Merged
hoyosjs merged 6 commits into
dotnet:mainfrom
hoyosjs:hoyosjs/cdac-dbi-live-debugging
Jul 28, 2026
Merged

hoyosjs merged 6 commits into
dotnet:mainfrom
hoyosjs:hoyosjs/cdac-dbi-live-debugging

Conversation

@hoyosjs

@hoyosjs hoyosjs commented Jul 24, 2026

Copy link
Copy Markdown
Member
  • 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.

- 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.
Copilot AI review requested due to automatic review settings July 24, 2026 10:27
@hoyosjs
hoyosjs requested a review from a team as a code owner July 24, 2026 10:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SetCDacLoadPolicy dbgshim 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 CreateDebuggingInterfaceFromVersion3 and RegisterForRuntimeStartup3.

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.

Comment thread src/dbgshim/dbgshim.cpp Resolved
Comment thread src/dbgshim/dbgshim.cpp Resolved
Comment thread src/dbgshim/debugshim.cpp Resolved
Comment thread src/dbgshim/debugshim.h Resolved
Comment thread src/dbgshim/debugshim.h Resolved
Comment thread src/dbgshim/debugshim.h Resolved
Comment thread src/dbgshim/debugshim.h Resolved
@hoyosjs
hoyosjs merged commit 0885e1c into dotnet:main Jul 28, 2026
25 checks passed
@hoyosjs
hoyosjs deleted the hoyosjs/cdac-dbi-live-debugging branch July 28, 2026 02:00
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants