Core/CrashHandler: Support dumping variables stored in cpu registers (not accurate for all variables)

(cherry picked from commit 0743a2f7bb)
This commit is contained in:
Shauren
2024-02-17 13:15:49 +01:00
parent 120b4d7cf4
commit 2cb5f7a81e

View File

@@ -1323,7 +1323,13 @@ EnumerateSymbolsCallbackContext* pCtx)
pVariable += *registerValue;
}
else if (pSym->Flags & IMAGEHLP_SYMBOL_INFO_REGISTER)
return false; // Don't try to report register variable
{
registerVariableStorage = GetIntegerRegisterValue(pCtx->context, pSym->Register);
if (!registerVariableStorage)
return false; // Don't try to report non-integer register variable
pVariable = reinterpret_cast<DWORD_PTR>(&*registerVariableStorage);
}
else
{
// It must be a global variable