Skip to content

Commit 4271678

Browse files
authored
Fix debugger stack unwind AV (#84270)
In the debugger we do not have in-memory pointers to the context record. Stack unwinds are all concrete, and update pCurrentContext instead. Due to this, this change 60adacb zeroed out the m_Ptrs variable for all callee saved registers. This change wasn't sufficient, however, because we actually try to use pCurrentContextPointers in a variety of places while dealing with reporting GC references, leading to an AV when GcInfoDecoder::GetStackSlot attempts to report an offset to RBP for certain kinds of coreclr!Frames. This change updates pCurrentContextPointers to point to pCurrentContext in the dac. (This issue/change only applies to AMD64.)
1 parent b1812ef commit 4271678

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coreclr/vm/amd64/cgenamd64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
155155
ENUM_CALLEE_SAVED_REGISTERS();
156156
#undef CALLEE_SAVED_REGISTER
157157

158-
#define CALLEE_SAVED_REGISTER(regname) pRD->pCurrentContextPointers->regname = pUnwoundState->m_Ptrs.p##regname;
158+
#define CALLEE_SAVED_REGISTER(regname) pRD->pCurrentContextPointers->regname = &pRD->pCurrentContext->regname;
159159
ENUM_CALLEE_SAVED_REGISTERS();
160160
#undef CALLEE_SAVED_REGISTER
161161

0 commit comments

Comments
 (0)