Skip to content

Fix objRef not being stored in GetPointerData after DebuggerIPCE_ObjectData refactor#129539

Open
tommcdon wants to merge 2 commits into
dotnet:mainfrom
tommcdon:dev/tommcdon/fix-cdac-getpointerdata
Open

Fix objRef not being stored in GetPointerData after DebuggerIPCE_ObjectData refactor#129539
tommcdon wants to merge 2 commits into
dotnet:mainfrom
tommcdon:dev/tommcdon/fix-cdac-getpointerdata

Conversation

@tommcdon

Copy link
Copy Markdown
Member

In GetPointerData, the local copy path reads the object reference from localValue into a temporary void* but never writes it back to m_info.objRef. The reference is lost, causing subsequent dereferences to fail.

This breaks debugger visualization for any value type that goes through GetPointerData (byref, pointer types), including Span<T> whose internal ByReference<T> field is read through this path.

Fix by writing the read pointer back to m_info.objRef after localCopy.

…ctData refactor

PR dotnet#129200 refactored DebuggerIPCE_ObjectData into DacDbiObjectData, changing
objRef from void* to CORDB_ADDRESS. In GetPointerData, the local copy path
reads the object reference from localValue into a temporary void* but never
writes it back to m_info.objRef. The reference is lost, causing subsequent
dereferences to fail.

This breaks debugger visualization for any value type that goes through
GetPointerData (byref, pointer types), including Span<T> whose internal
ByReference<T> field is read through this path.

Fix by writing the read pointer back to m_info.objRef after localCopy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tommcdon tommcdon added this to the 11.0.0 milestone Jun 17, 2026
@tommcdon tommcdon requested a review from rcj1 June 17, 2026 21:04
@tommcdon tommcdon self-assigned this Jun 17, 2026
Copilot AI review requested due to automatic review settings June 17, 2026 21:04
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Copilot AI 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 corrects CordbReferenceValue::GetPointerData so that when the object reference is sourced from a local cached buffer (localValue), the read pointer is actually persisted into m_info.objRef (so subsequent operations use the correct address).

Changes:

  • Read the pointer value from localValue into a temporary void*.
  • Store the read pointer back into m_info.objRef via PTR_TO_CORDB_ADDRESS(...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants