Implement cDAC DACDBI GetObjectFields and rework signature to UINT64#128179
Implement cDAC DACDBI GetObjectFields and rework signature to UINT64#128179Copilot wants to merge 3 commits into
Conversation
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
This PR updates the DAC/DBI GetObjectFields pathway: it implements GetObjectFields in the managed cDAC DacDbiImpl using RuntimeTypeSystem/metadata contracts, and it changes the native IDacDbiInterface::GetObjectFields signature to take a UINT64 (method table pointer) instead of COR_TYPEID (since only token1 was used).
Changes:
- Implemented managed cDAC
DacDbiImpl.GetObjectFieldsincluding field offsets and field type resolution via contracts + ECMA metadata decoding. - Updated native DACDBI interface and call site to pass a
UINT64id (id.token1) instead of a fullCOR_TYPEID. - Added dump-based tests covering
GetObjectFieldssuccess and key error/query scenarios.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiObjectDumpTests.cs | Adds dump-based tests for GetObjectFields behavior and contract cross-validation. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs | Updates managed COM projection signature for GetObjectFields to take ulong. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs | Implements GetObjectFields in managed cDAC using runtime contracts + metadata signature decoding. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/RuntimeTypeSystemHelpers/ExtensionMethods.cs | Changes helper extension class visibility to public to enable cross-assembly use. |
| src/coreclr/inc/dacdbi.idl | Changes native IDacDbiInterface::GetObjectFields parameter type to UINT64. |
| src/coreclr/debug/inc/dacdbiinterface.h | Updates the C++ interface signature accordingly. |
| src/coreclr/debug/di/process.cpp | Adjusts CordbProcess::GetTypeFields to pass id.token1. |
| src/coreclr/debug/daccess/dacdbiimpl.h | Updates DAC implementation declaration to match new signature. |
| src/coreclr/debug/daccess/dacdbiimpl.cpp | Updates DAC implementation definition to match new signature and adjusts related comment. |
Copilot's findings
- Files reviewed: 9/9 changed files
- Comments generated: 2
| if (rts.IsContinuation(typeHandle)) | ||
| { | ||
| TargetPointer continuationMT = rts.GetParentMethodTable(typeHandle); | ||
| if (continuationMT != TargetPointer.Null) | ||
| typeHandle = rts.GetTypeHandle(continuationMT); | ||
| } |
There was a problem hiding this comment.
We may want to encapsulate the UpCastTypeIfNeeded into RTS, I think this will be needed in other spots as well.
There was a problem hiding this comment.
I'm not sure that this belongs in RTS though. Its only purpose is to give the debugger a type that is not a special JIT-created type in order to fetch data from it. I'd say this should be a helper in DacDbi.
There was a problem hiding this comment.
You saw what I did in the other PR.
There was a problem hiding this comment.
Shall we leave it as-is for now, merge this one first, and use the shared helper in #128001?
Implements
GetObjectFieldsin the managed cDAC DAC-DBI layer usingRuntimeTypeSystemcontracts, and reworks the native interface to take aUINT64instead ofCOR_TYPEID(onlytoken1was ever consumed).