Commit MetaInfo

Revisióna995f0ed3cac6134c4e383b94c242dbf15d661cb (tree)
Tiempo2016-12-08 21:07:52
AutorMagnus Norddahl <dpjudas@user...>
CommiterMagnus Norddahl

Log Message

Fix crash reporter for 64 bit

Cambiar Resumen

Diferencia incremental

diff -r 8844950c6771 -r a995f0ed3cac src/win32/i_main.cpp
--- a/src/win32/i_main.cpp Fri Dec 26 14:41:01 2014 -0600
+++ b/src/win32/i_main.cpp Thu Dec 08 13:07:52 2016 +0100
@@ -1216,6 +1216,11 @@
12161216 //
12171217 //==========================================================================
12181218
1219+namespace
1220+{
1221+ CONTEXT MainThreadContext;
1222+}
1223+
12191224 LONG WINAPI CatchAllExceptions (LPEXCEPTION_POINTERS info)
12201225 {
12211226 #ifdef _DEBUG
@@ -1240,11 +1245,7 @@
12401245 // Otherwise, put the crashing thread to sleep and signal the main thread to clean up.
12411246 if (GetCurrentThreadId() == MainThreadID)
12421247 {
1243-#ifndef _M_X64
1244- info->ContextRecord->Eip = (DWORD_PTR)ExitFatally;
1245-#else
1246- info->ContextRecord->Rip = (DWORD_PTR)ExitFatally;
1247-#endif
1248+ *info->ContextRecord = MainThreadContext;
12481249 }
12491250 else
12501251 {
@@ -1336,6 +1337,15 @@
13361337 if (MainThread != INVALID_HANDLE_VALUE)
13371338 {
13381339 SetUnhandledExceptionFilter (CatchAllExceptions);
1340+
1341+ static bool setJumpResult = false;
1342+ RtlCaptureContext(&MainThreadContext);
1343+ if (setJumpResult)
1344+ {
1345+ ExitFatally(0);
1346+ return 0;
1347+ }
1348+ setJumpResult = true;
13391349 }
13401350 #endif
13411351
Show on old repository browser