Skip to content

Conversation

@rcj1
Copy link
Contributor

@rcj1 rcj1 commented Oct 24, 2025

This PR does some work and refactoring in order to facilitate a private version of the cDAC.

  1. Assuming that we may want to access some of the legacy APIs from the private cDAC, I have pulled the legacy code into a separate package and made the COM interop classes public for use.
  2. I have added a mechanism to add new contract implementations to a target upon instantiation of the target. This way the private cDAC can add its own contracts.
  3. Exposing GetContract. The private cDAC can in the future call GetContract with contracts not found in the default contract registry. This will probably be hidden behind an extension method but we need GetContract public for implementation.

@dotnet-policy-service
Copy link
Contributor

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

@Copilot Copilot AI review requested due to automatic review settings October 24, 2025 22:13
Copy link
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 refactors the legacy cDAC APIs to support a future private cDAC implementation by:

  • Extracting legacy code into a separate package (Microsoft.Diagnostics.DataContractReader.Legacy) with public visibility
  • Adding extensibility for custom contract implementations via additionalFactories parameter
  • Exposing GetContract<TContract>() publicly to enable access to contracts outside the default registry

Reviewed Changes

Copilot reviewed 23 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
mscordaccore_universal.csproj Updates project reference to point to the new Legacy package and removes obsolete Interop.BOOL.cs reference
Entrypoints.cs Makes entrypoint methods public and passes null for additionalFactories parameter in initialization calls
ContractDescriptorTarget.cs Adds additionalFactories parameter to creation methods and passes it to CachingContractRegistry
CachingContractRegistry.cs Adds logic to register additional contract factories during initialization
TypeNameBuilder.cs Changes visibility to public and fixes ArgumentException constructor call
SOSDacImpl.cs Changes class visibility from internal to public
SOSDacImpl.IXCLRDataProcess.cs Changes class visibility to public and seals EnumMethodInstances class
SOSDacImpl.ICLRDataEnumMemoryRegions.cs Changes class visibility from internal to public
OutputBufferHelpers.cs Changes class visibility from internal to public
Microsoft.Diagnostics.DataContractReader.Legacy.csproj New project file for the Legacy package
Interop.BOOL.cs New file containing BOOL enum previously shared via CommonPath
IXCLRData.cs Changes all interface and struct visibility from internal to public
ISOSDacInterface.cs Changes all interface, struct, and enum visibility from internal to public
ICLRData.cs Changes interface visibility from internal to public
ConversionExtensions.cs Changes class and ToAddress method visibility to public
ClrDataTask.cs Changes class visibility from internal to public
ClrDataStackWalk.cs Changes class visibility from internal to public
ClrDataModule.cs Changes class visibility from internal to public
ClrDataMethodInstance.cs Changes class visibility from internal to public
ClrDataFrame.cs Changes class visibility from internal to public
ClrDataAddress.cs Changes struct and marshaller visibility from internal to public
IContractFactory.cs Adds ContractType property to interface
ContractRegistry.cs Adds abstract GetContract() method

@rcj1 rcj1 marked this pull request as draft October 24, 2025 22:50
@rcj1 rcj1 marked this pull request as ready for review October 24, 2025 23:01
@rcj1 rcj1 merged commit 3fe8518 into dotnet:main Oct 25, 2025
149 of 153 checks passed
@rcj1 rcj1 deleted the cdac-private-updates branch October 25, 2025 23:07
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.

2 participants