cDAC: Add GetGCDescSeries contract API and continuation pretty-printing#127419
cDAC: Add GetGCDescSeries contract API and continuation pretty-printing#127419
Conversation
…ation pretty-printing Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/6e988c50-2e06-4957-952d-9b624dd862ca Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the cDAC RuntimeTypeSystem contract surface to expose GCDesc “series” (GC pointer runs) and uses that information to pretty-print dynamically-created continuation types in a way that mirrors the runtime’s AsyncContinuationsManager::PrintContinuationName.
Changes:
- Add
IRuntimeTypeSystem.GetGCDescSeriesand implement it inRuntimeTypeSystem_1to enumerate GC pointer runs from the GCDesc preceding a MethodTable. - Add continuation synthetic-name formatting to
TypeNameBuilderusingGetGCDescSeries. - Add a new
ContinuationObjectdata descriptor/type entry plus mocks, tests, and contract documentation updates.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.RuntimeTypeSystem.cs | Adds mock helpers to allocate MethodTables with GCDesc (regular + repeating/value-class layouts) and exposes ContinuationObjectSize. |
| src/native/managed/cdac/tests/MethodTableTests.cs | Adds unit tests covering GetGCDescSeries behaviors across MethodTable/non-MethodTable, no-GC, regular series, and repeating series cases. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/TypeNameBuilder.cs | Uses IsContinuation + GetGCDescSeries to generate the Continuation_<dataSize>[_<gcOffset>_<gcCount>]* synthetic name instead of (dynamicClass). |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs | Implements GetGCDescSeries by reading GCDesc memory preceding the MethodTable and normalizing sizes. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/DataType.cs | Adds DataType.ContinuationObject for retrieving continuation header sizing info from the contract descriptor. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs | Adds the GetGCDescSeries(TypeHandle, uint objectSize) contract API. |
| src/coreclr/vm/datadescriptor/datadescriptor.inc | Adds a ContinuationObject type descriptor entry so the reader can query its size. |
| docs/design/datacontracts/RuntimeTypeSystem.md | Updates contract documentation to include the new API and describe GCDesc series layouts. |
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
|
|
Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/e9402571-fdfe-4171-b9e1-eec00046cb3e Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
|
@copilot please update tests to fix #127419 (comment) |
…t array layout) Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/75d6d0fd-625a-49be-aa26-57c65e734608 Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Fixed in eddce51. The two failing tests now pass |
|
/ba-g comment only change |
🤖 Copilot Code Review — PR #127419Note This review was generated by Copilot (Claude Opus 4.6) with corroborating analysis from GPT-5.3-Codex and Claude Haiku 4.5. Holistic AssessmentMotivation: The PR adds GCDesc parsing and continuation type pretty-printing to the cdac (diagnostics DataContractReader). This enables the managed debugger to read GC pointer runs from memory and produce human-readable names for dynamically-created continuation method tables, matching the native Approach: The implementation correctly mirrors the native CGCDesc memory layout (both regular positive-numSeries and value-class negative-numSeries formats). The Summary: Detailed Findings✅ Correctness — GCDesc parsing logic matches native layoutThe regular series path correctly reads from ✅ Correctness — AppendContinuationName matches native behaviorThe managed implementation correctly uses
|
Summary
Implements continuation pretty-printing in the cDAC, mirroring
AsyncContinuationsManager::PrintContinuationNamefromasynccontinuations.h, and adds a newGetGCDescSeriesAPI to theRuntimeTypeSystemcontract.Fixes the WebApp3 test failure seen in recent runtime-diagnostics legs such as this: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1395576
The
GetGCDescSeriesAPI accepts an optionalnumComponentsparameter (defaulting to0for non-array types) and handles both regular (positiveNumSeries) and value-class repeating (negativeNumSeries) GCDesc layouts. For value-class GCDesc, the outer loop iteratesnumComponentstimes — callers must pass the actual element count to enumerate pointer runs across array elements.Note
This PR was created with the assistance of GitHub Copilot (AI-generated content).