Uh oh!
There was an error while loading. Please reload this page.
[cDAC] Implement DacDbi APIs TypeHandleToExpandedTypeInfo and GetObjectExpandedTypeInfo - #128001
Conversation
add fill expanded type data apis
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
This PR extends the cDAC DacDbi surface to produce DebuggerIPCE_ExpandedTypeData for a type handle or object address, and adds a RuntimeTypeSystem contract helper for recognizing the System.Object method table (so ELEMENT_TYPE_OBJECT can be reported distinctly from ELEMENT_TYPE_CLASS).
Changes:
- Add
IRuntimeTypeSystem.IsObject(TypeHandle)and plumb a newObjectMethodTableglobal through the contract + test mocks. - Implement
TypeHandleToExpandedTypeInfoandGetObjectExpandedTypeInfoin the managedDacDbiImpl, including little-endian writes matching nativePortable<T>. - Update native DBI interface/IDL and call sites to route “type id -> type info” through
TypeHandleToExpandedTypeInfo, and removeGetObjectExpandedTypeInfoFromID.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.RuntimeTypeSystem.cs | Adds a mock global for the Object method table and patches it to System.Object’s MT in the mock target. |
| src/native/managed/cdac/tests/MethodTableTests.cs | Extends contract globals and asserts IsObject behavior for FreeObject MT vs System.Object MT. |
| src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs | Adds dump-based assertions for IsObject across object/free/string MTs. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs | Introduces managed projections of AreValueTypesBoxed and DebuggerIPCE_*TypeData and updates method signatures to typed pointers. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs | Implements TypeHandleToExpandedTypeInfo / GetObjectExpandedTypeInfo and shared filling helpers with Portable-compatible endianness. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs | Reads the ObjectMethodTable global and implements IsObject. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs | Adds the new IsObject(TypeHandle) API to the public contract interface. |
| src/coreclr/inc/dacdbi.idl | Changes TypeHandleToExpandedTypeInfo to take a raw UINT64 and drops GetObjectExpandedTypeInfoFromID. |
| src/coreclr/debug/inc/dacdbistructures.h | Gives AreValueTypesBoxed explicit values (0/1/2). |
| src/coreclr/debug/inc/dacdbiinterface.h | Updates the COM interface signature and removes GetObjectExpandedTypeInfoFromID. |
| src/coreclr/debug/di/rstype.cpp | Updates RS to call the new TypeHandleToExpandedTypeInfo signature (but currently extracts the handle unsafely). |
| src/coreclr/debug/di/process.cpp | Routes GetTypeForTypeID through TypeHandleToExpandedTypeInfo using COR_TYPEID.token1. |
| src/coreclr/debug/daccess/dacdbiimpl.h | Updates DAC interface declaration to match the new signature. |
| src/coreclr/debug/daccess/dacdbiimpl.cpp | Removes the old FromID method and updates implementation/callers for the new signature + zero-inits output structs. |
| docs/design/datacontracts/RuntimeTypeSystem.md | Documents IsObject and the ObjectMethodTable global (but the globals table still has an incorrect FreeObject global name). |
Copilot's findings
- Files reviewed: 15/15 changed files
- Comments generated: 5
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rcj1
commented
May 19, 2026
/ba-g shebang analyzer issue |
After #128058 goes in the
memcpyfrom a VMPTR will be awkward but correct. I figured it's ok that it's awkward because this is not really something we should be doing all the time.