[cDAC] Implement DacDbi API GetMetaDataFileInfoFromPEFile#129484
Conversation
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
1 similar comment
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
This PR updates the cDAC Loader contract to obtain module path information from PEAssembly/PEImage (including a diagnostic filename hint for in-memory modules) and adds PE header parsing (timestamp + SizeOfImage) to support implementing the DacDbi GetMetaDataFileInfoFromPEFile API in the legacy layer.
Changes:
- Replace
GetPath(ModuleHandle)withGetPath(TargetPointer peAssemblyPtr, bool fallbackToHint = false)and addGetFileHeadersInfo(...)onILoader. - Move exported “path” data from
ModuletoPEImage(Path+ModuleFileNameHint) and plumb native CDAC descriptors accordingly. - Add/adjust unit + dump tests and update Loader contract documentation to reflect the new API shape.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/UnitTests/MockDescriptors/MockDescriptors.RuntimeMutableTypeSystem.cs | Removes mocked Module.Path field from layout. |
| src/native/managed/cdac/tests/UnitTests/MockDescriptors/MockDescriptors.Loader.cs | Removes mocked Module.Path plumbing and related builder inputs. |
| src/native/managed/cdac/tests/UnitTests/LoaderTests.cs | Adds tests + PE-image target builder for new Loader APIs. |
| src/native/managed/cdac/tests/DumpTests/LoaderDumpTests.cs | Updates dump test to call GetPath(GetPEAssembly(handle)). |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs | Updates legacy SOS path queries to use PEAssembly-based GetPath. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs | Implements GetMetaDataFileInfoFromPEFile using new Loader APIs. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataModule.cs | Updates module path/in-memory detection to use PEAssembly-based GetPath. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/PEImage.cs | Adds PEImage.Path + PEImage.ModuleFileNameHint fields to contract data. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/Module.cs | Removes Module.Path field from contract data. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/ImageOptionalHeader.cs | Adds SizeOfImage raw offset field. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/ImageFileHeader.cs | Adds TimeDateStamp raw offset field. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Loader_1.cs | Implements new Loader APIs and removes GetPath(ModuleHandle). |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/ILoader.cs | Public interface change: adds new members and removes GetPath(ModuleHandle). |
| src/coreclr/vm/peimage.h | Exposes PEImage path + hint buffers via CDAC offsets. |
| src/coreclr/vm/datadescriptor/datadescriptor.inc | Removes Module.Path descriptor; adds PEImage.Path + ModuleFileNameHint. |
| src/coreclr/vm/ceeload.h | Removes cdac_data<Module>::Path offset. |
| src/coreclr/inc/sstring.h | Adds cdac_data<SString>::Buffer helper offset. |
| src/coreclr/inc/sbuffer.h | Adds friend access needed for cdac_data<SString> offset computation. |
| docs/design/datacontracts/Loader.md | Updates contract docs for new GetPath / GetFileHeadersInfo and data fields. |
Copilot's findings
- Files reviewed: 19/19 changed files
- Comments generated: 7
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This reverts commit 2adb30f.
noahfalk
left a comment
There was a problem hiding this comment.
LGTM modulo a few comments inline
Copilot Code ReviewHolistic AssessmentMotivation: Justified. This implements the Approach: Sound. The new Summary: Detailed FindingsDetailed Findings✅ Contract implementation —
|
|
/ba-g #129820 |
Uh oh!
There was an error while loading. Please reload this page.