Skip to content

Replace EnumerateModulesInAssembly with combined GetModuleForAssembly; implement in cDAC#128294

Merged
rcj1 merged 6 commits into
mainfrom
copilot/replace-enumerate-modules-in-assembly
May 30, 2026
Merged

Replace EnumerateModulesInAssembly with combined GetModuleForAssembly; implement in cDAC#128294
rcj1 merged 6 commits into
mainfrom
copilot/replace-enumerate-modules-in-assembly

Conversation

Copilot AI commented May 17, 2026

Copy link
Copy Markdown
Contributor
  • Implement GetAssemblyFromModule in cDAC
  • Fold EnumerateModulesInAssembly into an IsLoaded check in GetModuleForAssembly

Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
@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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 17, 2026 03:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 17, 2026 04:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Copilot finished work on behalf of rcj1 May 17, 2026 04:19
Comment thread src/coreclr/debug/di/process.cpp Outdated
Copilot AI review requested due to automatic review settings May 19, 2026 23:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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: 2

Comment thread src/coreclr/debug/inc/dacdbiinterface.h
Comment thread src/coreclr/debug/di/shimprocess.cpp

@max-charlamb max-charlamb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems good to me, we may want a review from

@noahfalk for the dbi changes

@noahfalk noahfalk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice simplification :)

@rcj1 rcj1 merged commit 9d4ceae into main May 30, 2026
122 of 126 checks passed
@rcj1 rcj1 deleted the copilot/replace-enumerate-modules-in-assembly branch May 30, 2026 00:17
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone May 30, 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.

5 participants