1
0
Fork 0

Move SafeSymCleanup() call to cbExitProcess so it isn't called when the process may have already terminated

debugLoopFunction: set fdProcessInfo->hProcess and fdProcessInfo->hThread to NULL as these shouldn't be used after this point. The actual CloseHandle calls on these two handles are done by kernel32!ContinueDebugEvent immediately after cbExitProcess
This commit is contained in:
Mattiwatti 2017-11-27 20:36:27 +01:00 committed by Duncan Ogilvie
parent 2f3f28746d
commit 70a836b17a
1 changed files with 3 additions and 4 deletions

View File

@ -1457,6 +1457,8 @@ static void cbExitProcess(EXIT_PROCESS_DEBUG_INFO* ExitProcess)
_dbg_animatestop(); // Stop animating
//unload main module
SafeSymUnloadModule64(fdProcessInfo->hProcess, pCreateProcessBase);
//cleanup dbghelp
SafeSymCleanup(fdProcessInfo->hProcess);
//history
dbgcleartracestate();
dbgClearRtuBreakpoints();
@ -2734,10 +2736,6 @@ static void debugLoopFunction(void* lpParameter, bool attach)
stopInfo.reserved = 0;
plugincbcall(CB_STOPDEBUG, &stopInfo);
//cleanup dbghelp
if(fdProcessInfo->hProcess != nullptr)
SafeSymCleanup(fdProcessInfo->hProcess);
//message the user/do final stuff
RemoveAllBreakPoints(UE_OPTION_REMOVEALL); //remove all breakpoints
{
@ -2757,6 +2755,7 @@ static void debugLoopFunction(void* lpParameter, bool attach)
GuiSetDebugState(stopped);
GuiUpdateAllViews();
dputs(QT_TRANSLATE_NOOP("DBG", "Debugging stopped!"));
fdProcessInfo->hProcess = fdProcessInfo->hThread = nullptr;
varset("$hp", (duint)0, true);
varset("$pid", (duint)0, true);
if(hProcessToken)