GetAssemblyModuleList cDAC implementation#117452
Merged
rcj1 merged 15 commits intodotnet:mainfrom Jul 15, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds the cDAC implementation for GetAssemblyModuleList and extends the loader contracts to support fetching a module pointer from an assembly reference.
- Implements
ISOSDacInterface.GetAssemblyModuleListinSOSDacImpl.cswith argument validation, loader dispatch, HRESULT mapping, and debug-time consistency checks against the legacy DAC. - Introduces a new
GetModulePointermethod on theILoaderinterface (abstraction and contract) and provides its implementation inLoader_1.cs. - Updates interface definitions in
ILoader.csto include the new API.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs | Full implementation of GetAssemblyModuleList, including error handling and DEBUG assertions |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Loader_1.cs | Implements ILoader.GetModulePointer, throwing on null or missing module |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/ILoader.cs | Adds default interface method GetModulePointer to the loader abstraction |
Comments suppressed due to low confidence (2)
src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs:228
- Add unit tests for GetAssemblyModuleList covering edge cases (null/zero assembly, zero count, and assemblies with multiple modules) to validate the new implementation.
int ISOSDacInterface.GetAssemblyModuleList(ClrDataAddress assembly, uint count, [In, MarshalUsing(CountElementName = "count"), Out] ClrDataAddress[] modules, uint* pNeeded)
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/ILoader.cs:80
- [nitpick] The new GetModulePointer interface method lacks XML doc comments. Consider adding a summary and parameter/return descriptions to maintain documentation consistency.
TargetPointer GetModulePointer(TargetPointer assemblyPointer) => throw new NotImplementedException();
src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs
Outdated
Show resolved
Hide resolved
...tive/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/ILoader.cs
Outdated
Show resolved
Hide resolved
src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs
Outdated
Show resolved
Hide resolved
src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs
Outdated
Show resolved
Hide resolved
src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs
Outdated
Show resolved
Hide resolved
...tive/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/ILoader.cs
Outdated
Show resolved
Hide resolved
src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs
Outdated
Show resolved
Hide resolved
...native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Loader_1.cs
Outdated
Show resolved
Hide resolved
Open
3 tasks
...tive/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/ILoader.cs
Outdated
Show resolved
Hide resolved
...native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Loader_1.cs
Outdated
Show resolved
Hide resolved
src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs
Outdated
Show resolved
Hide resolved
max-charlamb
approved these changes
Jul 15, 2025
Member
max-charlamb
left a comment
There was a problem hiding this comment.
Code changes lgtm 👍
After the runtime-diagnostics pipeline passes lets merge this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding the implementation of the GetAssemblyModuleList API to the cDAC