Skip to content

[cDAC] Implement ISOSDacImpl.GetAssemblyList #114800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

max-charlamb
Copy link
Contributor

As part of work for #114336, the cDAC now supports iterating Assemblies in an AppDomain so this API falls out nicely.

It is also used as part of !dumpdomain and is relatively easy to test.

@Copilot Copilot AI review requested due to automatic review settings April 17, 2025 19:27
Copy link
Contributor

@Copilot 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 implements the ISOSDacImpl.GetAssemblyList API to support iterating assemblies within an AppDomain. Key changes include:

  • Implementation of the GetAssemblyList method in SOSDacImpl.cs with appropriate argument checks, exception handling, and debug validation.
  • Addition of new data types (e.g. LoaderAllocator, ArrayListBase, and related cdac_data specializations) and updates to the assembly and appdomain data models to support the new functionality.
  • Updates to the ILoader interface and associated loaders in the DataContractReader.Contracts to enumerate assemblies based on various iteration flags.

Reviewed Changes

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

Show a summary per file
File Description
src/native/managed/cdacreader/src/Legacy/SOSDacImpl.cs Implements the GetAssemblyList API with error checks and debug validation against legacy implementations.
src/native/managed/cdacreader/Microsoft.Diagnostics.DataContractReader.Contracts/Data/LoaderAllocator.cs Introduces LoaderAllocator data type for tracking loader allocations.
src/native/managed/cdacreader/Microsoft.Diagnostics.DataContractReader.Contracts/Data/Assembly.cs Extends the Assembly data type with new fields (Module, Error, NotifyFlags, Level) to support assembly status.
src/native/managed/cdacreader/Microsoft.Diagnostics.DataContractReader.Contracts/Data/ArrayListBase.cs Provides implementation for ArrayListBase and its block elements using modern collection initialization.
src/native/managed/cdacreader/Microsoft.Diagnostics.DataContractReader.Contracts/Data/AppDomain.cs Adds DomainAssemblyList field for improved assembly enumeration in AppDomains.
src/native/managed/cdacreader/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Loader_1.cs Updates ILoader contract with GetAssemblies and IsAssemblyLoaded methods.
Other coreclr and datadescriptor files Updates to cdac_data and constant definitions to support the new APIs.

Copy link
Contributor

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

@@ -1913,9 +1916,10 @@ class SystemDomain final

InlineSString<100> m_SystemDirectory;

public:
// Global domain that every one uses
SPTR_DECL(SystemDomain, m_pSystemDomain);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if there is a better way to access this global in the datadescriptors. Ideally, I don't want to change its access modifier.

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.

1 participant