Skip to content

[cDAC] Implementing cDAC DacDbi API methods EnumerateMethodDescParams and EnumerateTypeHandleParams #128517

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/implement-dacdbi-api-methods
Open

[cDAC] Implementing cDAC DacDbi API methods EnumerateMethodDescParams and EnumerateTypeHandleParams #128517
Copilot wants to merge 4 commits into
mainfrom
copilot/implement-dacdbi-api-methods

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

Refactor GetMethodDescParams and GetTypeHandleParams into enumeration methods. No new contracts.

…rameterized DacDbiArray allocator

Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 23, 2026 04:30
Copilot AI review requested due to automatic review settings May 23, 2026 04:30
@rcj1 rcj1 changed the title Implementing DacDbi API methods with custom allocator [cDAC] Implementing cDAC DacDbi API methods with generic Type Parameters May 23, 2026
Copilot AI review requested due to automatic review settings May 23, 2026 04:33
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the DAC/DBI type-parameter retrieval APIs to use callback-based enumeration instead of returning allocated TypeParamsList buffers, and wires up the necessary supporting infrastructure on both the native (DAC/DBI + RS) and managed cDAC sides.

Changes:

  • Replace GetMethodDescParams / GetTypeHandleParams with EnumerateMethodDescParams / EnumerateTypeHandleParams across the native interface, DAC implementation, and RS call sites (using a new CallbackAccumulator adapter).
  • Implement the new enumeration APIs in managed cDAC (DacDbiImpl), including generic-token resolution logic and System.__Canon fallback for per-parameter failures.
  • Add a new cDAC global (CanonMethodTable) and bump the DAC/DBI protocol breaking-change counter.
Show a summary per file
File Description
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs Updates managed COM interface signatures to the new callback-based enumeration methods.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs Implements enumeration logic in cDAC and adds helper logic for parent matching and __Canon fallback.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Constants.cs Adds Globals.CanonMethodTable to enable managed cDAC to resolve System.__Canon.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs Minor formatting change (no functional contract API change).
src/coreclr/vm/datadescriptor/datadescriptor.inc Publishes the CanonMethodTable global pointer for cDAC readers.
src/coreclr/debug/inc/dacdbistructures.h Bumps kCurrentDacDbiProtocolBreakingChangeCounter to reflect the breaking interface change.
src/coreclr/debug/inc/dacdbiinterface.h Introduces FP_TYPEPARAM_CALLBACK and replaces the two APIs with enumeration-based equivalents.
src/coreclr/debug/di/rstype.cpp Updates RS type instantiation to use enumeration + accumulator instead of TypeParamsList returned from DAC.
src/coreclr/debug/di/rsthread.cpp Updates generic-arg loading paths to use enumeration + accumulator.
src/coreclr/debug/di/rspriv.h Adds a pointer-item callback adapter to CallbackAccumulator for FP_TYPEPARAM_CALLBACK.
src/coreclr/debug/daccess/dacdbiimpl.h Updates DAC implementation method declarations and associated comments.
src/coreclr/debug/daccess/dacdbiimpl.cpp Implements the new enumeration methods in DAC and switches to callback emission.

Copilot's findings

  • Files reviewed: 12/12 changed files
  • Comments generated: 4

Comment thread src/coreclr/debug/inc/dacdbistructures.h
Comment thread src/coreclr/debug/daccess/dacdbiimpl.h Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 23, 2026 05:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 11/11 changed files
  • Comments generated: 4

Comment thread src/coreclr/debug/inc/dacdbiinterface.h
@rcj1 rcj1 marked this pull request as ready for review May 23, 2026 06:56
@rcj1 rcj1 changed the title [cDAC] Implementing cDAC DacDbi API methods with generic Type Parameters [cDAC] Implementing cDAC DacDbi API methods EnumerateMethodDescParams and EnumerateTypeHandleParams May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants