Skip to content

[cDAC] Update DebugInfo contract for new format - #121418

Merged
max-charlamb merged 13 commits into
dotnet:mainfrom
max-charlamb:cdac-debuginfo-2
Dec 1, 2025
Merged

[cDAC] Update DebugInfo contract for new format#121418
max-charlamb merged 13 commits into
dotnet:mainfrom
max-charlamb:cdac-debuginfo-2

Conversation

@max-charlamb

@max-charlambmax-charlamb commented Nov 6, 2025

Copy link
Copy Markdown
Member

See context for changes: #120303 (comment)

markdown lint failure is unrelated and fixed in: #121421

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces version 2 of the DebugInfo contract with a unified header format, while refactoring common code into a helper class. The new version replaces the flag byte approach of version 1 with a fat/slim chunk table for better extensibility.

  • Adds DebugInfo_2 implementing a new header format that encodes chunk sizes in nibble format
  • Extracts the bounds decoding logic into DebugInfoHelpers.DoBounds() for code reuse between versions
  • Updates documentation to describe the version 2 header encoding format
  • Removes PatchpointInfo data descriptors and related CDAC infrastructure

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/DebugInfo/DebugInfo_2.csImplements version 2 of the DebugInfo contract with unified fat/slim header format for chunk size encoding
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/DebugInfo/DebugInfo_1.csRefactored to use shared DebugInfoHelpers.DoBounds() method
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/DebugInfo/DebugInfoHelpers.csNew helper class containing shared bounds decoding logic with parameterized IL offset bias
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/DebugInfo/DebugInfoFactory.csRegisters version 2 implementation in the factory
src/coreclr/vm/datadescriptor/datadescriptor.incRemoves PatchpointInfo type definition from CDAC data descriptors
src/coreclr/inc/patchpointinfo.hRemoves CDAC-related template specialization and friend declarations
docs/design/datacontracts/DebugInfo.mdDocuments version 2 header encoding and removes incorrect CodeVersions contract reference from version 1
Comments suppressed due to low confidence (1)

src/coreclr/vm/datadescriptor/datadescriptor.inc:667

  • The removal of the PatchpointInfo type will break DebugInfo_1 which still depends on it. The DebugInfo_1.cs implementation (lines 51-55) uses DataType.PatchpointInfo to read patchpoint information when the EXTRA_DEBUG_INFO_PATCHPOINT flag is set. This type definition should not be removed unless DebugInfo_1 is also updated to not rely on it, or Version 1 is being completely removed.
CDAC_TYPE_BEGIN(CodeHeapListNode)
CDAC_TYPE_FIELD(CodeHeapListNode, /*pointer*/, Next, offsetof(HeapList, hpNext))
CDAC_TYPE_FIELD(CodeHeapListNode, /*pointer*/, StartAddress, offsetof(HeapList, startAddress))
CDAC_TYPE_FIELD(CodeHeapListNode, /*pointer*/, EndAddress, offsetof(HeapList, endAddress))
CDAC_TYPE_FIELD(CodeHeapListNode, /*pointer*/, MapBase, offsetof(HeapList, mapBase))
CDAC_TYPE_FIELD(CodeHeapListNode, /*pointer*/, HeaderMap, offsetof(HeapList, pHdrMap))
CDAC_TYPE_END(CodeHeapListNode)

Comment threadsrc/coreclr/inc/patchpointinfo.h
Comment threaddocs/design/datacontracts/DebugInfo.md Outdated
Comment threaddocs/design/datacontracts/DebugInfo.md
Comment threaddocs/design/datacontracts/DebugInfo.md
@max-charlamb

Copy link
Copy Markdown
MemberAuthor

Known unrelated failure in runtime-diagnostics cDAC pipeline: #117785

@max-charlamb
max-charlamb merged commit f84ba39 into dotnet:mainDec 1, 2025
100 of 102 checks passed
@max-charlamb
max-charlamb deleted the cdac-debuginfo-2 branch December 1, 2025 14:52
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 1, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@max-charlamb@noahfalk@jakobbotsch@davidwrighton