Repository navigation
Gate cDAC live debugging on DOTNET_CDAC_LIVE_DEBUGGING env var - #5944
Merged
Merged
Conversation
TryCreateCoreDbgWithCDac returns E_NOTIMPL unless the env var is set to '1', keeping cDAC disabled by default on the live-debug paths (RegisterForRuntimeStartup* and CreateDebuggingInterfaceFromVersion*). SetCDacLoadPolicy and the OpenVirtualProcess path are unaffected. Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in gate for using cDAC in live debugging activation paths in dbgshim, requiring DOTNET_CDAC_LIVE_DEBUGGING=1 before attempting cDAC so that experimental behavior doesn’t activate by default when a bundled cDAC is present.
Changes:
- Gate
TryCreateCoreDbgWithCDacbehindDOTNET_CDAC_LIVE_DEBUGGING=1, returningE_NOTIMPLwhen not enabled soPreferCDaccallers can transparently fall back. - Update
CDacLoadPolicydocumentation indbgshim.hto describe the new gating behavior for live-debugging entrypoints.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/dbgshim/dbgshim.h | Documents the live-debugging cDAC opt-in gate for CDacLoadPolicy. |
| src/dbgshim/dbgshim.cpp | Implements the DOTNET_CDAC_LIVE_DEBUGGING environment variable gate in TryCreateCoreDbgWithCDac. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
noahfalk
approved these changes
Jul 29, 2026
noahfalk
left a comment
Member
There was a problem hiding this comment.
I think we might need to tweak the error handling, but otherwise looks good.
- Fix Clang build error: SString::Equals takes const SString& but W() produces
a raw char16_t literal. Use SL(W("1")) (SString::Literal ctor) instead.
- Apply cdacEvaluated = false guard when TryCreateCoreDbgWithCDac returns
E_NOTIMPL at the two remaining call sites (was only at the first). This
ensures SelectActivationResult returns the legacy DAC error instead of
E_NOTIMPL when the env var gate is not set.
Co-authored-by: Copilot App <[email protected]>
- Keep live-debug cDAC env-var gate in TryCreateCoreDbgWithCDac. - Remove per-call-site cdacEvaluated toggles for E_NOTIMPL in live paths. - Update SelectActivationResult to treat E_NOTIMPL as non-actionable and prefer fallback errors when available. - Preserve caller fallback seed values and policy gating behavior. Co-authored-by: Copilot App <[email protected]>
Member
Author
|
/ba-g error is already correlated. |
noahfalk
approved these changes
Jul 31, 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.
cDAC support for the live-debugging paths (
RegisterForRuntimeStartup*andCreateDebuggingInterfaceFromVersion*) is experimental. Without an opt-in gate it activates by default for any process that has the bundled cDAC present, which is premature.TryCreateCoreDbgWithCDacnow returnsE_NOTIMPLunlessDOTNET_CDAC_LIVE_DEBUGGING=1is set. Callers withPreferCDacpolicy fall back to the legacy DAC transparently;CDacOnlycallers fail as expected since they have explicitly demanded cDAC.SetCDacLoadPolicyand theOpenVirtualProcess(dump/attach) path are unaffected.The
CDacLoadPolicyenum comment indbgshim.his updated to document the gate.