Skip to content

Runtime-async continuation object reading with Cordb - #121432

Merged
rcj1 merged 2 commits into
dotnet:mainfrom
rcj1:continuation-cordb
Dec 1, 2025
Merged

Runtime-async continuation object reading with Cordb#121432
rcj1 merged 2 commits into
dotnet:mainfrom
rcj1:continuation-cordb

Conversation

@rcj1

@rcj1rcj1 commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

This PR ensures that we are able to access continuation objects through APIs such as CordbObjectValue::GetFieldValue. As the dynamically generated continuation types with the local variable fields do not have metadata, we use the parent class which does have metadata. We will therefore not be able to view the locals fields through these APIs, but with the low likelihood that someone is digging this deep into implementation details, this should be an acceptable trade-off.

@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 PR adds special handling for continuation types in the debugger to map them to their base continuation class type for debugging purposes. The variable name "IfSubTypeCreated" suggests this is a lazily-initialized global that may be NULL before any continuation subtypes are created.

  • Adds checks for continuation types using IsContinuation() in debugger type conversion functions
  • Replaces continuation subtypes with the base continuation class type (g_pContinuationClassIfSubTypeCreated) for debugger type information
  • Applies this pattern consistently across both EE debugger and DAC debugger interface implementations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

FileDescription
src/coreclr/debug/ee/debugger.cppAdds continuation type handling in TypeHandleToBasicTypeInfo and TypeHandleToExpandedTypeInfo to replace continuation types with base class
src/coreclr/debug/daccess/dacdbiimpl.cppAdds continuation type handling in GetClassTypeInfo and TypeHandleToBasicTypeInfo (DAC version) with same replacement pattern

Comment threadsrc/coreclr/debug/ee/debugger.cpp Outdated
Comment threadsrc/coreclr/debug/ee/debugger.cpp Outdated
Comment threadsrc/coreclr/debug/daccess/dacdbiimpl.cpp Outdated
Comment threadsrc/coreclr/debug/daccess/dacdbiimpl.cpp Outdated
Comment threadsrc/coreclr/debug/daccess/dacdbiimpl.cpp Outdated
Comment threadsrc/coreclr/debug/daccess/dacdbiimpl.cpp Outdated

@thaystgthaystg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@rcj1

rcj1 commented Dec 1, 2025

Copy link
Copy Markdown
ContributorAuthor

/ba-g unrelated fails

@rcj1
rcj1 merged commit 96b4bf9 into dotnet:mainDec 1, 2025
87 of 99 checks passed
@rcj1
rcj1 deleted the continuation-cordb branch December 1, 2025 17:58
@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.

7 participants

@rcj1@thaystg@noahfalk@jkotas@max-charlamb@VSadov