aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-02-17 13:15:49 +0100
committerShauren <shauren.trinity@gmail.com>2024-02-17 13:15:49 +0100
commit0743a2f7bb193bb26a3f148bb86e2b3a28d9905e (patch)
tree0c8a123264784397e39648e71ffbf1a1737b29f8
parent2441ddbea6e9865bd6027c6ecc144559d13393b9 (diff)
Core/CrashHandler: Support dumping variables stored in cpu registers (not accurate for all variables)
-rw-r--r--src/common/Debugging/WheatyExceptionReport.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/common/Debugging/WheatyExceptionReport.cpp b/src/common/Debugging/WheatyExceptionReport.cpp
index 0879913cb76..ab851a7d2e5 100644
--- a/src/common/Debugging/WheatyExceptionReport.cpp
+++ b/src/common/Debugging/WheatyExceptionReport.cpp
@@ -1326,7 +1326,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