1
0
Fork 0

DBG: warn the user when they are trying to use servers inside the symbol store path (this will attempt downloading symbols on every module load, which makes everything slow)

This commit is contained in:
Mr. eXoDia 2015-07-13 07:09:48 +02:00
parent 4b109b9647
commit 2e77565151
1 changed files with 18 additions and 4 deletions

View File

@ -18,6 +18,7 @@
#include "_dbgfunctions.h"
#include "debugger_commands.h"
#include "capstone_wrapper.h"
#include "_scriptapi_gui.h"
static MESSAGE_STACK* gMsgStack = 0;
static COMMAND* command_list = 0;
@ -274,11 +275,24 @@ extern "C" DLL_EXPORT const char* _dbg_dbginit()
strcpy_s(dbbasepath, dir); //debug directory
strcat_s(dbbasepath, "\\db");
CreateDirectoryW(StringUtils::Utf8ToUtf16(dbbasepath).c_str(), 0); //create database directory
if(!BridgeSettingGet("Symbols", "CachePath", szSymbolCachePath))
char szLocalSymbolPath[MAX_PATH] = "";
strcpy_s(szLocalSymbolPath, dir);
strcat_s(szLocalSymbolPath, "\\symbols");
if(!BridgeSettingGet("Symbols", "CachePath", szSymbolCachePath) || !*szSymbolCachePath)
{
strcpy_s(szSymbolCachePath, dir);
strcat_s(szSymbolCachePath, "\\symbols");
BridgeSettingSet("Symbols", "CachePath", szSymbolCachePath);
strcpy_s(szSymbolCachePath, szLocalSymbolPath);
BridgeSettingSet("Symbols", "CachePath", szLocalSymbolPath);
}
else
{
if(strstr(szSymbolCachePath, "http://") || strstr(szSymbolCachePath, "https://"))
{
if(Script::Gui::MessageYesNo("It is strongly discouraged to use symbol servers in your path directly (use the store option instead).\n\nDo you want me to fix this?"))
{
strcpy_s(szSymbolCachePath, szLocalSymbolPath);
BridgeSettingSet("Symbols", "CachePath", szLocalSymbolPath);
}
}
}
SetCurrentDirectoryW(StringUtils::Utf8ToUtf16(dir).c_str());
dputs("Allocating message stack...");