未验证 提交 0419950e 编写于 作者: J Jan Vorlicek 提交者: GitHub

Fix HelperMethodFrame::UpdateRegDisplay on x86 (#65589)

While running managed debugger tests with x86 runtime debug build, I was
hiting an assert in MachineState::pRetAddress() method in a couple of
tests.
It turns out there was a bug in the HelperMethodFrame::UpdateRegDisplay
introduced about 5 years ago that only happens in DAC. The m_MachState
can be uninitialized when we enter the method and we were calling
m_MachState.pRetAddr() before performing the initialization.

This change fixes it.
上级 ca6f4206
......@@ -289,8 +289,6 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
LOG((LF_GCROOTS, LL_INFO100000, "STACKWALK HelperMethodFrame::UpdateRegDisplay cached ip:%p, sp:%p\n", m_MachState.GetRetAddr(), m_MachState.esp()));
pRD->PCTAddr = dac_cast<TADDR>(m_MachState.pRetAddr());
#ifdef FEATURE_EH_FUNCLETS
pRD->IsCallerContextValid = FALSE;
......@@ -306,6 +304,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
InsureInit(false, pUnwoundState);
pRD->PCTAddr = dac_cast<TADDR>(pUnwoundState->pRetAddr());
pRD->pCurrentContext->Eip = pRD->ControlPC = pUnwoundState->GetRetAddr();
pRD->pCurrentContext->Esp = pRD->SP = pUnwoundState->esp();
......@@ -325,6 +324,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
}
#endif // DACCESS_COMPILE
pRD->PCTAddr = dac_cast<TADDR>(m_MachState.pRetAddr());
pRD->pCurrentContext->Eip = pRD->ControlPC = m_MachState.GetRetAddr();
pRD->pCurrentContext->Esp = pRD->SP = (DWORD) m_MachState.esp();
......@@ -401,6 +401,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
pRD->pEbx = (DWORD*) m_MachState.pEbx();
pRD->pEbp = (DWORD*) m_MachState.pEbp();
pRD->PCTAddr = dac_cast<TADDR>(m_MachState.pRetAddr());
pRD->ControlPC = m_MachState.GetRetAddr();
pRD->SP = (DWORD) m_MachState.esp();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册