1
0
Fork 0

DBG: move call to CB_STOPDEBUG to the very end of the debug loop

close issue #1899
This commit is contained in:
Duncan Ogilvie 2018-02-14 20:41:16 +01:00
parent 2c284cd210
commit 16fdf57f41
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
1 changed files with 6 additions and 1 deletions

View File

@ -68,6 +68,7 @@ static EXCEPTION_DEBUG_INFO lastExceptionInfo = { 0 };
static char szDebuggeeInitializationScript[MAX_PATH] = "";
static WString gInitExe, gInitCmd, gInitDir, gDllLoader;
static CookieQuery cookie;
static bool bDatabaseLoaded = false;
char szProgramDir[MAX_PATH] = "";
char szFileName[MAX_PATH] = "";
char szSymbolCachePath[MAX_PATH] = "";
@ -1341,6 +1342,7 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo)
// Init program database
DbLoad(DbLoadSaveType::DebugData);
bDatabaseLoaded = true;
SafeSymSetOptions(SYMOPT_IGNORE_CVREC | SYMOPT_DEBUG | SYMOPT_LOAD_LINES | SYMOPT_FAVOR_COMPRESSED | SYMOPT_IGNORE_NT_SYMPATH);
GuiSymbolLogClear();
@ -2549,6 +2551,7 @@ static void debugLoopFunction(void* lpParameter, bool attach)
bIsAttached = attach;
dbgsetskipexceptions(false);
bFreezeStack = false;
bDatabaseLoaded = false;
//prepare attach/createprocess
DWORD pid;
@ -2716,6 +2719,9 @@ static void debugLoopFunction(void* lpParameter, bool attach)
DebugLoop();
}
if(bDatabaseLoaded) //fixes data loss when attach failed (https://github.com/x64dbg/x64dbg/issues/1899)
DbClose();
//call plugin callback
PLUG_CB_STOPDEBUG stopInfo;
stopInfo.reserved = 0;
@ -2731,7 +2737,6 @@ static void debugLoopFunction(void* lpParameter, bool attach)
//cleanup
dbgcleartracestate();
dbgClearRtuBreakpoints();
DbClose();
ModClear();
ThreadClear();
WatchClear();