DBG: move call to CB_STOPDEBUG to the very end of the debug loop
close issue #1899
This commit is contained in:
parent
2c284cd210
commit
16fdf57f41
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue