1
0
Fork 0

Remove Show ASCII/Unicode in address dump mode option

closes #2498
This commit is contained in:
Duncan Ogilvie 2020-10-31 13:37:14 +01:00
parent 1d10dc549e
commit 9b40810902
6 changed files with 1 additions and 98 deletions

View File

@ -24,12 +24,10 @@ CPUDump::CPUDump(CPUDisassembly* disas, CPUMultiDump* multiDump, QWidget* parent
if(BridgeSettingGetUint("Gui", "AsciiSeparator", &setting))
mAsciiSeparator = setting & 0xF;
asciiAddressDumpModeUpdatedSlot();
setView((ViewEnum_t)ConfigUint("HexDump", "DefaultView"));
connect(this, SIGNAL(selectionUpdated()), this, SLOT(selectionUpdatedSlot()));
connect(this, SIGNAL(headerButtonReleased(int)), this, SLOT(headerButtonReleasedSlot(int)));
connect(Config(), SIGNAL(asciiAddressDumpModeUpdated()), this, SLOT(asciiAddressDumpModeUpdatedSlot()));
mPluginMenu = multiDump->mDumpPluginMenu;
@ -270,7 +268,7 @@ void CPUDump::setupContextMenu()
wFloatMenu->addAction(makeAction(DIcon("80bit-float.png"), tr("&Long double (80-bit)"), SLOT(floatLongDoubleSlot())));
mMenuBuilder->addMenu(makeMenu(DIcon("float.png"), tr("&Float")), wFloatMenu);
mMenuBuilder->addAction(makeAction(DIcon("address.png"), tr("&Address"), SLOT(addressSlot())));
mMenuBuilder->addAction(makeAction(DIcon("address.png"), tr("&Address"), SLOT(addressAsciiSlot())));
mMenuBuilder->addAction(makeAction(DIcon("processor-cpu.png"), tr("&Disassembly"), SLOT(disassemblySlot())));
mMenuBuilder->addSeparator();
@ -1221,50 +1219,8 @@ void CPUDump::floatLongDoubleSlot()
reloadData();
}
void CPUDump::addressSlot()
{
if(mAsciiAddressDumpMode)
{
addressAsciiSlot();
return;
}
Config()->setUint("HexDump", "DefaultView", (duint)ViewAddress);
int charwidth = getCharWidth();
ColumnDescriptor wColDesc;
DataDescriptor dDesc;
wColDesc.isData = true; //void*
wColDesc.itemCount = 1;
wColDesc.separator = 0;
#ifdef _WIN64
wColDesc.data.itemSize = Qword;
wColDesc.data.qwordMode = HexQword;
#else
wColDesc.data.itemSize = Dword;
wColDesc.data.dwordMode = HexDword;
#endif
appendResetDescriptor(8 + charwidth * 2 * sizeof(duint), tr("Value"), false, wColDesc);
wColDesc.isData = false; //comments
wColDesc.itemCount = 1;
wColDesc.separator = 0;
dDesc.itemSize = Byte;
dDesc.byteMode = AsciiByte;
wColDesc.data = dDesc;
appendDescriptor(0, tr("Comments"), false, wColDesc);
reloadData();
}
void CPUDump::addressAsciiSlot()
{
if(!mAsciiAddressDumpMode)
{
addressSlot();
return;
}
Config()->setUint("HexDump", "DefaultView", (duint)ViewAddressAscii);
int charwidth = getCharWidth();
ColumnDescriptor wColDesc;
@ -1310,12 +1266,6 @@ void CPUDump::addressAsciiSlot()
void CPUDump::addressUnicodeSlot()
{
if(!mAsciiAddressDumpMode)
{
addressSlot();
return;
}
Config()->setUint("HexDump", "DefaultView", (duint)ViewAddressUnicode);
int charwidth = getCharWidth();
ColumnDescriptor wColDesc;
@ -1806,8 +1756,6 @@ void CPUDump::setView(ViewEnum_t view)
floatLongDoubleSlot();
break;
case ViewAddress:
addressSlot();
break;
case ViewAddressAscii:
addressAsciiSlot();
break;
@ -1837,18 +1785,3 @@ void CPUDump::headerButtonReleasedSlot(int colIndex)
if(callback)
callback();
}
void CPUDump::asciiAddressDumpModeUpdatedSlot()
{
duint setting = 0;
mAsciiAddressDumpMode = BridgeSettingGetUint("Gui", "AsciiAddressDumpMode", &setting) && setting;
auto defaultView = (ViewEnum_t)ConfigUint("HexDump", "DefaultView");
switch(defaultView)
{
case ViewAddress:
case ViewAddressAscii:
case ViewAddressUnicode:
setView(defaultView);
break;
}
}

View File

@ -81,7 +81,6 @@ public slots:
void floatDoubleSlot();
void floatLongDoubleSlot();
void addressSlot();
void addressUnicodeSlot();
void addressAsciiSlot();
void disassemblySlot();
@ -113,7 +112,6 @@ public slots:
void followInMemoryMapSlot();
void headerButtonReleasedSlot(int colIndex);
void asciiAddressDumpModeUpdatedSlot();
private:
MenuBuilder* mMenuBuilder;
@ -127,7 +125,6 @@ private:
CPUDisassembly* mDisas;
CPUMultiDump* mMultiDump;
int mAsciiSeparator = 0;
bool mAsciiAddressDumpMode;
enum ViewEnum_t
{

View File

@ -17,7 +17,6 @@ SettingsDialog::SettingsDialog(QWidget* parent) :
adjustSize();
bTokenizerConfigUpdated = false;
bDisableAutoCompleteUpdated = false;
bAsciiAddressDumpModeUpdated = false;
LoadSettings(); //load settings from file
connect(Bridge::getBridge(), SIGNAL(setLastException(uint)), this, SLOT(setLastException(uint)));
lastException = 0;
@ -86,7 +85,6 @@ void SettingsDialog::LoadSettings()
settings.guiNoForegroundWindow = true;
settings.guiLoadSaveTabOrder = true;
settings.guiDisableAutoComplete = false;
settings.guiAsciiAddressDumpMode = false;
//Events tab
GetSettingBool("Events", "SystemBreakpoint", &settings.eventSystemBreakpoint);
@ -249,7 +247,6 @@ void SettingsDialog::LoadSettings()
GetSettingBool("Gui", "GraphZoomMode", &settings.guiGraphZoomMode);
GetSettingBool("Gui", "ShowExitConfirmation", &settings.guiShowExitConfirmation);
GetSettingBool("Gui", "DisableAutoComplete", &settings.guiDisableAutoComplete);
GetSettingBool("Gui", "AsciiAddressDumpMode", &settings.guiAsciiAddressDumpMode);
ui->chkFpuRegistersLittleEndian->setChecked(settings.guiFpuRegistersLittleEndian);
ui->chkSaveColumnOrder->setChecked(settings.guiSaveColumnOrder);
ui->chkNoCloseDialog->setChecked(settings.guiNoCloseDialog);
@ -261,7 +258,6 @@ void SettingsDialog::LoadSettings()
ui->chkGraphZoomMode->setChecked(settings.guiGraphZoomMode);
ui->chkShowExitConfirmation->setChecked(settings.guiShowExitConfirmation);
ui->chkDisableAutoComplete->setChecked(settings.guiDisableAutoComplete);
ui->chkAsciiAddressDumpMode->setChecked(settings.guiAsciiAddressDumpMode);
//Misc tab
if(DbgFunctions()->GetJit)
@ -406,7 +402,6 @@ void SettingsDialog::SaveSettings()
BridgeSettingSetUint("Gui", "GraphZoomMode", settings.guiGraphZoomMode);
BridgeSettingSetUint("Gui", "ShowExitConfirmation", settings.guiShowExitConfirmation);
BridgeSettingSetUint("Gui", "DisableAutoComplete", settings.guiDisableAutoComplete);
BridgeSettingSetUint("Gui", "AsciiAddressDumpMode", settings.guiAsciiAddressDumpMode);
//Misc tab
if(DbgFunctions()->GetJit)
@ -450,11 +445,6 @@ void SettingsDialog::SaveSettings()
emit Config()->disableAutoCompleteUpdated();
bDisableAutoCompleteUpdated = false;
}
if(bAsciiAddressDumpModeUpdated)
{
emit Config()->asciiAddressDumpModeUpdated();
bAsciiAddressDumpModeUpdated = false;
}
if(bGuiOptionsUpdated)
{
emit Config()->guiOptionsUpdated();
@ -919,12 +909,6 @@ void SettingsDialog::on_chkDisableAutoComplete_toggled(bool checked)
bDisableAutoCompleteUpdated = true;
}
void SettingsDialog::on_chkAsciiAddressDumpMode_toggled(bool checked)
{
settings.guiAsciiAddressDumpMode = checked;
bAsciiAddressDumpModeUpdated = true;
}
void SettingsDialog::on_chkUseLocalHelpFile_toggled(bool checked)
{
settings.miscUseLocalHelpFile = checked;

View File

@ -87,7 +87,6 @@ private slots:
void on_chkNoForegroundWindow_toggled(bool checked);
void on_chkShowExitConfirmation_toggled(bool checked);
void on_chkDisableAutoComplete_toggled(bool checked);
void on_chkAsciiAddressDumpMode_toggled(bool checked);
//Misc tab
void on_chkSetJIT_stateChanged(int arg1);
void on_chkConfirmBeforeAtt_stateChanged(int arg1);
@ -191,7 +190,6 @@ private:
bool guiGraphZoomMode;
bool guiShowExitConfirmation;
bool guiDisableAutoComplete;
bool guiAsciiAddressDumpMode;
//Misc Tab
bool miscSetJIT;
bool miscSetJITAuto;
@ -213,7 +211,6 @@ private:
bool bGuiOptionsUpdated;
bool bTokenizerConfigUpdated;
bool bDisableAutoCompleteUpdated;
bool bAsciiAddressDumpModeUpdated;
//functions
void GetSettingBool(const char* section, const char* name, bool* set);

View File

@ -738,13 +738,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkAsciiAddressDumpMode">
<property name="text">
<string>Show ASCII/Unicode in address dump mode</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacerGUI">
<property name="orientation">

View File

@ -112,7 +112,6 @@ signals:
void shortcutsUpdated();
void tokenizerConfigUpdated();
void disableAutoCompleteUpdated();
void asciiAddressDumpModeUpdated();
private:
QColor colorFromConfig(const QString & id);