Repository navigation
[cDAC] Mark unused APIs E_NOTIMPL and remove fallback - #130942
max-charlamb merged 1 commit into
Conversation
Co-authored-by: Copilot <[email protected]> Copilot-Session: f2aa5dc4-0c99-43f0-af14-734143849c4a
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
This PR reduces cDAC Legacy “fallback-to-legacy-DAC” behavior by changing a set of delegation-only wrapper methods to return HResults.E_NOTIMPL directly, narrowing the surface area that can route to the legacy DAC implementation.
Changes:
- Replaces legacy-fallback delegation with unconditional
E_NOTIMPLfor selectedIXCLRDataProcess,ISOSDacInterface, andIXCLRData*wrapper methods. - Removes now-unneeded legacy interface caching (
IXCLRDataFrame2cast field) after disabling delegation for that method set.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.IXCLRDataProcess.cs | Stops delegating several IXCLRDataProcess APIs (tasks/assemblies/notifications/etc.) to the legacy DAC, returning E_NOTIMPL instead. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs | Stops delegating selected ISOSDacInterface APIs (assembly location, DAC module handle, failed assembly APIs, GC handle enum-for-GC, heap alloc data) to the legacy DAC. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataTask.cs | Disables legacy delegation for several IXCLRDataTask APIs by returning E_NOTIMPL. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataStackWalk.cs | Disables legacy delegation for selected IXCLRDataStackWalk APIs (GetFrameType, SetContext, SetContext2). |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataModule.cs | Disables legacy delegation for selected IXCLRDataModule enumeration and lookup APIs by returning E_NOTIMPL. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataMethodInstance.cs | Disables legacy delegation for selected IXCLRDataMethodInstance APIs by returning E_NOTIMPL. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataMethodDefinition.cs | Disables legacy delegation for selected IXCLRDataMethodDefinition APIs by returning E_NOTIMPL. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataFrame.cs | Disables legacy delegation for selected IXCLRDataFrame/IXCLRDataFrame2 APIs and removes the unused cached IXCLRDataFrame2 legacy cast. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataAppDomain.cs | Disables legacy delegation for selected IXCLRDataAppDomain APIs by returning E_NOTIMPL. |
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Workflow state for the Holistic Review Orchestrator. {
"version": 5,
"last_dispatched_commit": "002ad73938f3f0dd2611f4f9810399d00612293b",
"last_dispatched_base_ref": "main",
"last_dispatched_base_sha": "509acfd47f3cbbaeddb6a49edadaedb8fdfdf9ad",
"last_reviewed_commit": "002ad73938f3f0dd2611f4f9810399d00612293b",
"last_reviewed_base_ref": "main",
"last_reviewed_base_sha": "509acfd47f3cbbaeddb6a49edadaedb8fdfdf9ad",
"last_recorded_worker_run_id": "29687167165",
"review_attempt_commit": "",
"review_attempt_base_ref": "",
"review_attempt_count": 0,
"max_review_attempts": 5,
"review_history_format": "holistic-review-disclosure-v1",
"review_history": [
{
"commit": "002ad73938f3f0dd2611f4f9810399d00612293b",
"review_id": 4730765878
}
]
} |
There was a problem hiding this comment.
Holistic Review
Motivation: The cDAC Legacy layer wraps each unmanaged IXCLRData*/ISOSDacInterface method, and for methods the cDAC does not implement it delegated to the legacy DAC via LegacyFallbackHelper.CanFallback() && _legacyImpl is not null ? _legacyImpl.Method(...) : E_NOTIMPL. For a selected set of APIs the team wants to stop delegating to the legacy DAC entirely, so that unsupported surface is explicitly unimplemented rather than silently backed by the old DAC. This tightens the boundary of what the cDAC actually stands behind.
Approach: Selected delegating expression bodies are replaced with a direct => HResults.E_NOTIMPL, dropping the CanFallback/_legacyImpl conditional for those specific methods. The change is purely mechanical and confined to the wrapper files; methods that already have real cDAC implementations, and delegating methods the team still wants to keep falling back (e.g. Request, StartEnumModules, GetAddressType, various enum helpers), are left untouched. In ClrDataFrame, the _legacyImpl2 field becomes unused after converting GetExactGenericArgsToken and is correctly removed along with its constructor assignment.
Summary: LGTM. The diff is a clean, well-scoped narrowing of legacy-DAC delegation. I verified the removed _legacyImpl2 field has no remaining references, and that the retained _legacyImpl/_legacyProcess/_legacyModule fields are still used by the many methods that continue to delegate, so no unused-field warnings are introduced. The behavioral effect is intentional: the converted APIs now return E_NOTIMPL unconditionally instead of forwarding to the legacy DAC when present. This is a deliberate design decision consistent with the PR's stated goal; consumers (SOS/debuggers) that previously relied on legacy fallback for these specific methods will now receive E_NOTIMPL, which is the intended contract. No correctness, safety, or performance concerns found in the changed lines, and I have no actionable findings.
Note
This review was generated by this repository's Holistic Review agentic workflow to complement the built-in Copilot review.
Generated by Holistic Review · 67.1 AIC · ⌖ 20 AIC · ⊞ 10K
Replace selected cDAC Legacy wrapper fallbacks with direct
E_NOTIMPLreturns.This narrows legacy-DAC delegation for unsupported APIs while preserving existing cDAC implementations and coherent enumeration behavior.
Note
This pull request description was generated with GitHub Copilot.