From a7ce43784b3c9645dbe04f36856d46806082f5a5 Mon Sep 17 00:00:00 2001 From: Jubal Date: Sun, 28 Jan 2018 17:28:25 -0500 Subject: [PATCH] added show jump lines in disassembly (#286) --- src/cutter.cpp | 3 ++- src/dialogs/preferences/AsmOptionsWidget.cpp | 9 ++++++++- src/dialogs/preferences/AsmOptionsWidget.h | 1 + src/dialogs/preferences/AsmOptionsWidget.ui | 11 +++++++++-- src/utils/Configuration.h | 3 +++ 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/cutter.cpp b/src/cutter.cpp index ea5c62ec..c3eaf767 100644 --- a/src/cutter.cpp +++ b/src/cutter.cpp @@ -507,6 +507,7 @@ void CutterCore::resetDefaultAsmOptions() setConfig("asm.offset", Config()->getAsmOffset()); setConfig("asm.describe", Config()->getAsmDescribe()); setConfig("asm.stackptr", Config()->getAsmStackPointer()); + setConfig("asm.lines", Config()->getAsmLines()); setConfig("asm.bytes", Config()->getAsmBytes()); setConfig("asm.bytespace", Config()->getAsmBytespace()); setConfig("asm.lbytes", Config()->getAsmLBytes()); @@ -525,6 +526,7 @@ void CutterCore::saveDefaultAsmOptions() Config()->setAsmOffset(getConfigb("asm.offset")); Config()->setAsmDescribe(getConfigb("asm.describe")); Config()->setAsmStackPointer(getConfigb("asm.stackptr")); + Config()->setAsmLines(getConfigb("asm.lines")); Config()->setAsmBytes(getConfigb("asm.bytes")); Config()->setAsmBytespace(getConfigb("asm.bytespace")); Config()->setAsmLBytes(getConfigb("asm.lbytes")); @@ -760,7 +762,6 @@ void CutterCore::getOpcodes() void CutterCore::setSettings() { setConfig("scr.interactive", false); - setConfig("asm.lines", false); // Intredazting... //setConfig("asm.linesright", "true"); //setConfig("asm.lineswidth", "15"); diff --git a/src/dialogs/preferences/AsmOptionsWidget.cpp b/src/dialogs/preferences/AsmOptionsWidget.cpp index 26e77fd5..9101e681 100644 --- a/src/dialogs/preferences/AsmOptionsWidget.cpp +++ b/src/dialogs/preferences/AsmOptionsWidget.cpp @@ -40,6 +40,7 @@ void AsmOptionsWidget::updateAsmOptionsFromVars() qhelpers::setCheckedWithoutSignals(ui->offsetCheckBox, Core()->getConfigb("asm.offset")); qhelpers::setCheckedWithoutSignals(ui->describeCheckBox, Core()->getConfigb("asm.describe")); qhelpers::setCheckedWithoutSignals(ui->stackpointerCheckBox, Core()->getConfigb("asm.stackptr")); + qhelpers::setCheckedWithoutSignals(ui->linesCheckBox, Core()->getConfigb("asm.lines")); bool bytesEnabled = Core()->getConfigb("asm.bytes"); qhelpers::setCheckedWithoutSignals(ui->bytesCheckBox, bytesEnabled); @@ -134,6 +135,12 @@ void AsmOptionsWidget::on_stackpointerCheckBox_toggled(bool checked) triggerAsmOptionsChanged(); } +void AsmOptionsWidget::on_linesCheckBox_toggled(bool checked) +{ + Core()->setConfig("asm.lines", checked); + triggerAsmOptionsChanged(); +} + void AsmOptionsWidget::on_bytesCheckBox_toggled(bool checked) { Core()->setConfig("asm.bytes", checked); @@ -225,4 +232,4 @@ void AsmOptionsWidget::on_buttonBox_clicked(QAbstractButton *button) default: break; } -} \ No newline at end of file +} diff --git a/src/dialogs/preferences/AsmOptionsWidget.h b/src/dialogs/preferences/AsmOptionsWidget.h index 87724227..a5de79fd 100644 --- a/src/dialogs/preferences/AsmOptionsWidget.h +++ b/src/dialogs/preferences/AsmOptionsWidget.h @@ -39,6 +39,7 @@ private slots: void on_offsetCheckBox_toggled(bool checked); void on_describeCheckBox_toggled(bool checked); void on_stackpointerCheckBox_toggled(bool checked); + void on_linesCheckBox_toggled(bool checked); void on_bytesCheckBox_toggled(bool checked); void on_bytespaceCheckBox_toggled(bool checked); void on_lbytesCheckBox_toggled(bool checked); diff --git a/src/dialogs/preferences/AsmOptionsWidget.ui b/src/dialogs/preferences/AsmOptionsWidget.ui index ca78d7e5..ca21adc1 100644 --- a/src/dialogs/preferences/AsmOptionsWidget.ui +++ b/src/dialogs/preferences/AsmOptionsWidget.ui @@ -6,8 +6,8 @@ 0 0 - 461 - 463 + 541 + 478 @@ -49,6 +49,13 @@ + + + + Show jump lines (asm.lines) + + + diff --git a/src/utils/Configuration.h b/src/utils/Configuration.h index fa9b5639..5ac64f9a 100644 --- a/src/utils/Configuration.h +++ b/src/utils/Configuration.h @@ -58,6 +58,9 @@ public: bool getAsmStackPointer() const { return s.value("asm.stackptr", false).toBool(); } void setAsmStackPointer(bool v) { s.setValue("asm.stackptr", v); } + bool getAsmLines() const { return s.value("asm.lines", false).toBool(); } + void setAsmLines(bool v) { s.setValue("asm.lines", v); } + bool getAsmBytes() const { return s.value("asm.bytes", false).toBool(); } void setAsmBytes(bool v) { s.setValue("asm.bytes", v); }