Implement native runtimes command --usecdac option - #5943
Merged
Conversation
Our tests expect to be able to toggle cDAC support on and off. Although most tests run with the managed host enabled, some of them explicitly disable it. Right now if a test disables managed SOS hosting and attempts to run: !runtimes --usecdac false the native host doesn't recognize the option and ignores it. The test then runs using default native host policy which will load cDAC. This means tests that claim to be validating the legacy DAC path are actually validating the SOS bundled cDAC instead. This was blocking Rachel's PR dotnet/runtime#131027 because she had both runtime and cDAC changes included but the test was only using the runtime portion of the change without the matching cDAC portion.
Member
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Adds native SOS support for toggling cDAC usage via !runtimes --usecdac ..., so tests that disable managed SOS hosting can explicitly exercise the legacy DAC path (or force cDAC) instead of silently following the native default policy.
Changes:
- Adds
--usecdacparsing to the native!runtimescommand, storing the selection in a global load policy and flushing runtime caches. - Plumbs a
CDacLoadPolicythrough the native runtime implementation and uses it to force/disable cDAC selection. - Prevents fallback to dbgeng/legacy paths when cDAC is explicitly forced and cDAC acquisition fails.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/SOS/Strike/util.cpp | Avoids falling back to dbgeng CLRData when cDAC is explicitly forced and cDAC load fails. |
| src/SOS/Strike/strike.cpp | Implements !runtimes --usecdac parsing, policy display, and cache flush. |
| src/SOS/Strike/platform/runtimeimpl.h | Introduces CDacLoadPolicy and exposes static getters/setters on Runtime. |
| src/SOS/Strike/platform/runtimeimpl.cpp | Implements the policy and integrates it into cDAC selection logic. |
| src/SOS/Strike/clrma/managedanalysis.cpp | Makes CLRMA’s DAC/cDAC acquisition respect the “force cDAC” policy by not falling back when forced. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rcj1
reviewed
Jul 29, 2026
hoyosjs
approved these changes
Jul 29, 2026
noahfalk
enabled auto-merge (squash)
July 29, 2026 21:53
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Our tests expect to be able to toggle cDAC support on and off. Although most tests run with the managed host enabled, some of them explicitly disable it. Right now if a test disables managed SOS hosting and attempts to run:
!runtimes --usecdac false
the native host doesn't recognize the option and ignores it. The test then runs using default native host policy which will load cDAC. This means tests that claim to be validating the legacy DAC path are actually validating the SOS bundled cDAC instead. This was blocking Rachel's PR dotnet/runtime#131027 because she had both runtime and cDAC changes included but the test was only using the runtime portion of the change without the matching cDAC portion.