Skip to content

Replace EnumerateModulesInAssembly with combined GetModuleForAssembly; implement in cDAC#128294

Open
Copilot wants to merge 5 commits into
mainfrom
copilot/replace-enumerate-modules-in-assembly
Open

Replace EnumerateModulesInAssembly with combined GetModuleForAssembly; implement in cDAC#128294
Copilot wants to merge 5 commits into
mainfrom
copilot/replace-enumerate-modules-in-assembly

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 17, 2026

  • Implement GetAssemblyFromModule in cDAC
  • Fold EnumerateModulesInAssembly into an IsLoaded check in GetModuleForAssembly

@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.

@rcj1 rcj1 marked this pull request as ready for review May 17, 2026 03:35
Copilot AI review requested due to automatic review settings May 17, 2026 03:35
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 refactors the DAC/DBI module-per-assembly query by folding the “is loaded” check into IDacDbiInterface::GetModuleForAssembly, removing the now-dead EnumerateModulesInAssembly callback API, and implementing the updated APIs in the cDAC (Microsoft.Diagnostics.DataContractReader.Legacy) along with updating dump-based tests.

Changes:

  • Extends GetModuleForAssembly to optionally return an “is module loaded” flag and removes EnumerateModulesInAssembly from the DAC/DBI contract.
  • Updates right-side (RS) codepaths that prepopulate/enumerate modules to use the combined API.
  • Implements the updated interface in cDAC and updates dump tests to validate the new signature/behavior.
Show a summary per file
File Description
src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiLoaderDumpTests.cs Updates dump tests to call the new GetModuleForAssembly signature and validate the loaded flag on success.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs Updates the managed COM projection to match the new vtable shape and removes the module-enumeration entry.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs Implements the new GetModuleForAssembly (with loaded flag) and implements GetAssemblyFromModule in cDAC; removes legacy fallback for module enumeration.
src/coreclr/inc/dacdbi.idl Updates the IDL contract: changes GetModuleForAssembly signature and removes EnumerateModulesInAssembly / its callback typedef.
src/coreclr/debug/inc/dacdbiinterface.h Updates the native interface definition and removes the module enumeration API documentation/signature.
src/coreclr/debug/di/rspriv.h Removes the RS module-enumeration callback declaration.
src/coreclr/debug/di/rsappdomain.cpp Switches prepopulation logic to call GetModuleForAssembly and gate cache population on the loaded flag.
src/coreclr/debug/di/process.cpp Rewrites shim module enumeration to use the combined GetModuleForAssembly + loaded flag logic.
src/coreclr/debug/daccess/dacdbiimpl.h Updates the DAC implementation class declaration to the new GetModuleForAssembly signature and removes module enumeration.
src/coreclr/debug/daccess/dacdbiimpl.cpp Implements the updated GetModuleForAssembly signature and removes the module enumeration implementation.

Copilot's findings

  • Files reviewed: 10/10 changed files
  • Comments generated: 3

Comment thread src/coreclr/inc/dacdbi.idl
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI review requested due to automatic review settings May 17, 2026 03:52
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: 10/10 changed files
  • Comments generated: 5

Comment thread src/coreclr/debug/daccess/dacdbiimpl.cpp
Comment thread src/coreclr/debug/daccess/dacdbiimpl.cpp Outdated
Comment thread src/coreclr/debug/di/rsappdomain.cpp
Comment thread src/coreclr/debug/di/process.cpp
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI review requested due to automatic review settings May 17, 2026 04:08
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: 10/10 changed files
  • Comments generated: 1

Comment thread src/coreclr/debug/daccess/dacdbiimpl.cpp
Copilot finished work on behalf of rcj1 May 17, 2026 04:19
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