diff --git a/src/common/Configuration.cpp b/src/common/Configuration.cpp index ad2e1fd1..5933d539 100644 --- a/src/common/Configuration.cpp +++ b/src/common/Configuration.cpp @@ -130,6 +130,7 @@ static const QHash asmOptions = { { "asm.refptr", false }, { "asm.flags.real", true }, { "asm.reloff", false }, + { "asm.reloff.flags", false }, { "esil.breakoninvalid",true }, { "graph.offset", false} }; diff --git a/src/dialogs/preferences/AsmOptionsWidget.cpp b/src/dialogs/preferences/AsmOptionsWidget.cpp index 279f6d63..11bc0fd2 100644 --- a/src/dialogs/preferences/AsmOptionsWidget.cpp +++ b/src/dialogs/preferences/AsmOptionsWidget.cpp @@ -35,6 +35,7 @@ AsmOptionsWidget::AsmOptionsWidget(PreferencesDialog *dialog) { ui->indentCheckBox, "asm.indent" }, { ui->offsetCheckBox, "asm.offset" }, { ui->relOffsetCheckBox, "asm.reloff" }, + { ui->relOffFlagsCheckBox, "asm.reloff.flags" }, { ui->slowCheckBox, "asm.slow" }, { ui->linesCheckBox, "asm.lines" }, { ui->fcnlinesCheckBox, "asm.lines.fcn" }, @@ -62,6 +63,7 @@ AsmOptionsWidget::AsmOptionsWidget(PreferencesDialog *dialog) connect(ui->asmComboBox, static_cast(&QComboBox::currentIndexChanged), this, &AsmOptionsWidget::asmComboBoxChanged); connect(ui->offsetCheckBox, &QCheckBox::toggled, this, &AsmOptionsWidget::offsetCheckBoxToggled); + connect(ui->relOffsetCheckBox, &QCheckBox::toggled, this, &AsmOptionsWidget::relOffCheckBoxToggled); connect(Core(), SIGNAL(asmOptionsChanged()), this, SLOT(updateAsmOptionsFromVars())); updateAsmOptionsFromVars(); } @@ -78,7 +80,9 @@ void AsmOptionsWidget::updateAsmOptionsFromVars() ui->cmtcolSpinBox->setEnabled(cmtRightEnabled); bool offsetsEnabled = Config()->getConfigBool("asm.offset") || Config()->getConfigBool("graph.offset"); + ui->relOffsetLabel->setEnabled(offsetsEnabled); ui->relOffsetCheckBox->setEnabled(offsetsEnabled); + ui->relOffFlagsCheckBox->setEnabled(Config()->getConfigBool("asm.offset") && Config()->getConfigBool("asm.reloff")); bool bytesEnabled = Config()->getConfigBool("asm.bytes"); ui->bytespaceCheckBox->setEnabled(bytesEnabled); @@ -263,7 +267,14 @@ void AsmOptionsWidget::asmComboBoxChanged(int index) void AsmOptionsWidget::offsetCheckBoxToggled(bool checked) { + ui->relOffsetLabel->setEnabled(checked || Config()->getConfigBool("graph.offset")); ui->relOffsetCheckBox->setEnabled(checked || Config()->getConfigBool("graph.offset")); + ui->relOffFlagsCheckBox->setEnabled(checked && Config()->getConfigBool("asm.reloff")); +} + +void AsmOptionsWidget::relOffCheckBoxToggled(bool checked) +{ + ui->relOffFlagsCheckBox->setEnabled(checked && Config()->getConfigBool("asm.offset")); } /** diff --git a/src/dialogs/preferences/AsmOptionsWidget.h b/src/dialogs/preferences/AsmOptionsWidget.h index 2269a08c..0847890a 100644 --- a/src/dialogs/preferences/AsmOptionsWidget.h +++ b/src/dialogs/preferences/AsmOptionsWidget.h @@ -53,6 +53,7 @@ private slots: void commentsComboBoxChanged(int index); void asmComboBoxChanged(int index); void offsetCheckBoxToggled(bool checked); + void relOffCheckBoxToggled(bool checked); void checkboxEnabler(QCheckBox *checkbox, QString config); }; diff --git a/src/dialogs/preferences/AsmOptionsWidget.ui b/src/dialogs/preferences/AsmOptionsWidget.ui index 511aca64..d9934ae5 100644 --- a/src/dialogs/preferences/AsmOptionsWidget.ui +++ b/src/dialogs/preferences/AsmOptionsWidget.ui @@ -65,33 +65,30 @@ Disassembly - - - - true + + + + Display the bytes of each instruction (asm.bytes) - - - - true - + + - Number of bytes to display (asm.nbytes): + Syntax (asm.syntax): Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - Tabs before assembly (asm.tabs.off): + + + + 100 - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + 5 @@ -105,54 +102,23 @@ - - - - 100 + + + + true - - 5 - - - - - - Separate bytes with whitespace (asm.bytespace) - - - - - - - Indent disassembly based on reflines depth (asm.indent) - - - - - - - 100 - - - 5 - - - - - - - Tabs in assembly (asm.tabs): + Number of bytes to display (asm.nbytes): Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - + + - Align bytes to the left (asm.lbytes) + Indent disassembly based on reflines depth (asm.indent) @@ -172,23 +138,11 @@ - - - - - Lowercase - - - - - Uppercase (asm.ucase) - - - - - Capitalize (asm.capitalize) - - + + + + true + @@ -210,13 +164,6 @@ - - - - Show empty line after every basic block (asm.bb.line) - - - @@ -224,37 +171,108 @@ - - + + - Syntax (asm.syntax): + Tabs before assembly (asm.tabs.off): Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - Display the bytes of each instruction (asm.bytes) - - - - + + + + Show empty line after every basic block (asm.bb.line) + + + + + + + + Lowercase + + + + + Uppercase (asm.ucase) + + + + + Capitalize (asm.capitalize) + + + + + + + + Align bytes to the left (asm.lbytes) + + + + + + + Separate bytes with whitespace (asm.bytespace) + + + + Display flags' real name (asm.flags.real) - - + + - Show offsets relative to a function (asm.reloff) + Tabs in assembly (asm.tabs): + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + 100 + + + 5 + + + + + + + + + Show offsets relative to: + + + + + + + Functions (asm.reloff) + + + + + + + + + Flags (asm.reloff.flags)