DBG: added options for disabling database compression and for saving the database in the program directory (not recommended). Resolved issue #287
This commit is contained in:
parent
4137e616ae
commit
6897c9dfd9
|
@ -51,8 +51,9 @@ void dbsave()
|
|||
dputs("\nFailed to write database file!");
|
||||
return;
|
||||
}
|
||||
hFile.Close();
|
||||
json_free(jsonText);
|
||||
if(!settingboolget("Engine", "DisableCompression"))
|
||||
if(!settingboolget("Engine", "DisableDatabaseCompression"))
|
||||
LZ4_compress_fileW(wdbpath.c_str(), wdbpath.c_str());
|
||||
}
|
||||
else //remove database when nothing is in there
|
||||
|
@ -74,7 +75,7 @@ void dbload()
|
|||
WString databasePathW = StringUtils::Utf8ToUtf16(dbpath);
|
||||
|
||||
// Decompress the file if compression was enabled
|
||||
bool useCompression = !settingboolget("Engine", "DisableCompression");
|
||||
bool useCompression = !settingboolget("Engine", "DisableDatabaseCompression");
|
||||
LZ4_STATUS lzmaStatus = LZ4_INVALID_ARCHIVE;
|
||||
{
|
||||
lzmaStatus = LZ4_decompress_fileW(databasePathW.c_str(), databasePathW.c_str());
|
||||
|
|
|
@ -632,7 +632,17 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo)
|
|||
#else
|
||||
strcat_s(sqlitedb, ".dd32");
|
||||
#endif // _WIN64
|
||||
sprintf(dbpath, "%s\\%s", dbbasepath, sqlitedb);
|
||||
if(settingboolget("Engine", "SaveDatabaseInProgramDirectory"))
|
||||
{
|
||||
char szFileDir[MAX_PATH] = "";
|
||||
strcpy_s(szFileDir, szFileName);
|
||||
char* pathEnd = strrchr(szFileDir, '\\');
|
||||
if(pathEnd)
|
||||
*pathEnd = '\0';
|
||||
sprintf_s(dbpath, "%s\\%s", szFileDir, sqlitedb);
|
||||
}
|
||||
else
|
||||
sprintf_s(dbpath, "%s\\%s", dbbasepath, sqlitedb);
|
||||
dprintf("Database file: %s\n", dbpath);
|
||||
dbload();
|
||||
SafeSymSetOptions(SYMOPT_DEBUG | SYMOPT_LOAD_LINES | SYMOPT_ALLOW_ABSOLUTE_SYMBOLS | SYMOPT_FAVOR_COMPRESSED | SYMOPT_IGNORE_NT_SYMPATH);
|
||||
|
|
|
@ -112,6 +112,8 @@ void SettingsDialog::LoadSettings()
|
|||
GetSettingBool("Engine", "UndecorateSymbolNames", &settings.engineUndecorateSymbolNames);
|
||||
GetSettingBool("Engine", "EnableDebugPrivilege", &settings.engineEnableDebugPrivilege);
|
||||
GetSettingBool("Engine", "EnableSourceDebugging", &settings.engineEnableSourceDebugging);
|
||||
GetSettingBool("Engine", "SaveDatabaseInProgramDirectory", &settings.engineSaveDatabaseInProgramDirectory);
|
||||
GetSettingBool("Engine", "DisableDatabaseCompression", &settings.engineDisableDatabaseCompression);
|
||||
switch(settings.engineCalcType)
|
||||
{
|
||||
case calc_signed:
|
||||
|
@ -136,6 +138,8 @@ void SettingsDialog::LoadSettings()
|
|||
ui->chkUndecorateSymbolNames->setChecked(settings.engineUndecorateSymbolNames);
|
||||
ui->chkEnableDebugPrivilege->setChecked(settings.engineEnableDebugPrivilege);
|
||||
ui->chkEnableSourceDebugging->setChecked(settings.engineEnableSourceDebugging);
|
||||
ui->chkSaveDatabaseInProgramDirectory->setChecked(settings.engineSaveDatabaseInProgramDirectory);
|
||||
ui->chkDisableDatabaseCompression->setChecked(settings.engineDisableDatabaseCompression);
|
||||
|
||||
//Exceptions tab
|
||||
char exceptionRange[MAX_SETTING_SIZE] = "";
|
||||
|
@ -233,6 +237,8 @@ void SettingsDialog::SaveSettings()
|
|||
BridgeSettingSetUint("Engine", "UndecorateSymbolNames", settings.engineUndecorateSymbolNames);
|
||||
BridgeSettingSetUint("Engine", "EnableDebugPrivilege", settings.engineEnableDebugPrivilege);
|
||||
BridgeSettingSetUint("Engine", "EnableSourceDebugging", settings.engineEnableSourceDebugging);
|
||||
BridgeSettingSetUint("Engine", "SaveDatabaseInProgramDirectory", settings.engineSaveDatabaseInProgramDirectory);
|
||||
BridgeSettingSetUint("Engine", "DisableDatabaseCompression", settings.engineDisableDatabaseCompression);
|
||||
|
||||
//Exceptions tab
|
||||
QString exceptionRange = "";
|
||||
|
@ -500,6 +506,16 @@ void SettingsDialog::on_chkEnableSourceDebugging_stateChanged(int arg1)
|
|||
settings.engineEnableSourceDebugging = arg1 == Qt::Checked;
|
||||
}
|
||||
|
||||
void SettingsDialog::on_chkDisableDatabaseCompression_stateChanged(int arg1)
|
||||
{
|
||||
settings.engineDisableDatabaseCompression = arg1 == Qt::Checked;
|
||||
}
|
||||
|
||||
void SettingsDialog::on_chkSaveDatabaseInProgramDirectory_stateChanged(int arg1)
|
||||
{
|
||||
settings.engineSaveDatabaseInProgramDirectory = arg1 == Qt::Checked;
|
||||
}
|
||||
|
||||
void SettingsDialog::on_btnAddRange_clicked()
|
||||
{
|
||||
ExceptionRangeDialog exceptionRange(this);
|
||||
|
|
|
@ -44,6 +44,8 @@ private slots:
|
|||
void on_chkUndecorateSymbolNames_stateChanged(int arg1);
|
||||
void on_chkEnableDebugPrivilege_stateChanged(int arg1);
|
||||
void on_chkEnableSourceDebugging_stateChanged(int arg1);
|
||||
void on_chkDisableDatabaseCompression_stateChanged(int arg1);
|
||||
void on_chkSaveDatabaseInProgramDirectory_stateChanged(int arg1);
|
||||
//Exception tab
|
||||
void on_btnAddRange_clicked();
|
||||
void on_btnDeleteRange_clicked();
|
||||
|
@ -107,6 +109,8 @@ private:
|
|||
bool engineUndecorateSymbolNames;
|
||||
bool engineEnableDebugPrivilege;
|
||||
bool engineEnableSourceDebugging;
|
||||
bool engineSaveDatabaseInProgramDirectory;
|
||||
bool engineDisableDatabaseCompression;
|
||||
//Exception Tab
|
||||
QList<RangeStruct>* exceptionRanges;
|
||||
//Disasm Tab
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabEvents">
|
||||
<attribute name="title">
|
||||
|
@ -256,6 +256,20 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkDisableDatabaseCompression">
|
||||
<property name="text">
|
||||
<string>Disable Database Compression</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkSaveDatabaseInProgramDirectory">
|
||||
<property name="text">
|
||||
<string>Save Database in Program Directory</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
|
Loading…
Reference in New Issue