From c0522a6ee7aa5c100483ebb337914056575675c0 Mon Sep 17 00:00:00 2001 From: Tom McDonald Date: Wed, 17 Jun 2026 16:55:07 -0400 Subject: [PATCH] Fix objRef not being stored in GetPointerData after DebuggerIPCE_ObjectData refactor PR #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 whose internal ByReference 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> --- src/coreclr/debug/di/divalue.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/debug/di/divalue.cpp b/src/coreclr/debug/di/divalue.cpp index 1ed670661d5555..bdee72007b4411 100644 --- a/src/coreclr/debug/di/divalue.cpp +++ b/src/coreclr/debug/di/divalue.cpp @@ -1454,8 +1454,9 @@ void CordbReferenceValue::GetPointerData(CorElementType type, MemoryRange localV // --------------- | _ASSERTE(localValue.Size() == sizeof(void *)); - void * pObjRef = CORDB_ADDRESS_TO_PTR(m_info.objRef); + void * pObjRef = NULL; localCopy(&pObjRef, localValue); + m_info.objRef = PTR_TO_CORDB_ADDRESS(pObjRef); } else {