Add asm.fcnlines option (Fix #248)

This commit is contained in:
Florian Märkl 2018-02-04 20:34:52 +01:00
parent e2d73763d9
commit 3dcd9cab9d
6 changed files with 24 additions and 3 deletions

View File

@ -513,6 +513,7 @@ void CutterCore::resetDefaultAsmOptions()
setConfig("asm.stackptr", Config()->getAsmStackPointer()); setConfig("asm.stackptr", Config()->getAsmStackPointer());
setConfig("asm.slow", Config()->getAsmSlow()); setConfig("asm.slow", Config()->getAsmSlow());
setConfig("asm.lines", Config()->getAsmLines()); setConfig("asm.lines", Config()->getAsmLines());
setConfig("asm.fcnlines", Config()->getAsmFcnLines());
setConfig("asm.emu", Config()->getAsmEmu()); setConfig("asm.emu", Config()->getAsmEmu());
setConfig("asm.cmtright", Config()->getAsmCmtRight()); setConfig("asm.cmtright", Config()->getAsmCmtRight());
setConfig("asm.varsum", Config()->getAsmVarSum()); setConfig("asm.varsum", Config()->getAsmVarSum());
@ -538,6 +539,7 @@ void CutterCore::saveDefaultAsmOptions()
Config()->setAsmStackPointer(getConfigb("asm.stackptr")); Config()->setAsmStackPointer(getConfigb("asm.stackptr"));
Config()->setAsmSlow(getConfigb("asm.slow")); Config()->setAsmSlow(getConfigb("asm.slow"));
Config()->setAsmLines(getConfigb("asm.lines")); Config()->setAsmLines(getConfigb("asm.lines"));
Config()->setAsmFcnLines(getConfigb("asm.fcnlines"));
Config()->setAsmEmu(getConfigb("asm.emu")); Config()->setAsmEmu(getConfigb("asm.emu"));
Config()->setAsmCmtRight(getConfigb("asm.cmtright")); Config()->setAsmCmtRight(getConfigb("asm.cmtright"));
Config()->setAsmVarSum(getConfigb("asm.varsum")); Config()->setAsmVarSum(getConfigb("asm.varsum"));
@ -782,7 +784,6 @@ void CutterCore::setSettings()
setConfig("hex.pairs", false); setConfig("hex.pairs", false);
setConfig("asm.cmtcol", 70); setConfig("asm.cmtcol", 70);
setConfig("asm.xrefs", false); setConfig("asm.xrefs", false);
setConfig("asm.fcnlines", false);
setConfig("asm.tabsonce", true); setConfig("asm.tabsonce", true);
setConfig("asm.tabsoff", 5); setConfig("asm.tabsoff", 5);

View File

@ -42,6 +42,7 @@ void AsmOptionsWidget::updateAsmOptionsFromVars()
qhelpers::setCheckedWithoutSignals(ui->stackpointerCheckBox, Core()->getConfigb("asm.stackptr")); qhelpers::setCheckedWithoutSignals(ui->stackpointerCheckBox, Core()->getConfigb("asm.stackptr"));
qhelpers::setCheckedWithoutSignals(ui->slowCheckBox, Core()->getConfigb("asm.slow")); qhelpers::setCheckedWithoutSignals(ui->slowCheckBox, Core()->getConfigb("asm.slow"));
qhelpers::setCheckedWithoutSignals(ui->linesCheckBox, Core()->getConfigb("asm.lines")); qhelpers::setCheckedWithoutSignals(ui->linesCheckBox, Core()->getConfigb("asm.lines"));
qhelpers::setCheckedWithoutSignals(ui->fcnlinesCheckBox, Core()->getConfigb("asm.fcnlines"));
qhelpers::setCheckedWithoutSignals(ui->emuCheckBox, Core()->getConfigb("asm.emu")); qhelpers::setCheckedWithoutSignals(ui->emuCheckBox, Core()->getConfigb("asm.emu"));
qhelpers::setCheckedWithoutSignals(ui->cmtrightCheckBox, Core()->getConfigb("asm.cmtright")); qhelpers::setCheckedWithoutSignals(ui->cmtrightCheckBox, Core()->getConfigb("asm.cmtright"));
qhelpers::setCheckedWithoutSignals(ui->varsumCheckBox, Core()->getConfigb("asm.varsum")); qhelpers::setCheckedWithoutSignals(ui->varsumCheckBox, Core()->getConfigb("asm.varsum"));
@ -161,6 +162,12 @@ void AsmOptionsWidget::on_linesCheckBox_toggled(bool checked)
triggerAsmOptionsChanged(); triggerAsmOptionsChanged();
} }
void AsmOptionsWidget::on_fcnlinesCheckBox_toggled(bool checked)
{
Core()->setConfig("asm.fcnlines", checked);
triggerAsmOptionsChanged();
}
void AsmOptionsWidget::on_emuCheckBox_toggled(bool checked) void AsmOptionsWidget::on_emuCheckBox_toggled(bool checked)
{ {
Core()->setConfig("asm.emu", checked); Core()->setConfig("asm.emu", checked);

View File

@ -41,6 +41,7 @@ private slots:
void on_stackpointerCheckBox_toggled(bool checked); void on_stackpointerCheckBox_toggled(bool checked);
void on_slowCheckBox_toggled(bool checked); void on_slowCheckBox_toggled(bool checked);
void on_linesCheckBox_toggled(bool checked); void on_linesCheckBox_toggled(bool checked);
void on_fcnlinesCheckBox_toggled(bool checked);
void on_emuCheckBox_toggled(bool checked); void on_emuCheckBox_toggled(bool checked);
void on_cmtrightCheckBox_toggled(bool checked); void on_cmtrightCheckBox_toggled(bool checked);
void on_varsumCheckBox_toggled(bool checked); void on_varsumCheckBox_toggled(bool checked);

View File

@ -63,6 +63,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="fcnlinesCheckBox">
<property name="text">
<string>Show function boundary lines (asm.fcnlines)</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="emuCheckBox"> <widget class="QCheckBox" name="emuCheckBox">
<property name="text"> <property name="text">

View File

@ -61,9 +61,12 @@ public:
bool getAsmSlow() const { return s.value("asm.slow", true).toBool(); } bool getAsmSlow() const { return s.value("asm.slow", true).toBool(); }
void setAsmSlow(bool v) { s.setValue("asm.slow", v); } void setAsmSlow(bool v) { s.setValue("asm.slow", v); }
bool getAsmLines() const { return s.value("asm.lines", false).toBool(); } bool getAsmLines() const { return s.value("asm.lines", true).toBool(); }
void setAsmLines(bool v) { s.setValue("asm.lines", v); } void setAsmLines(bool v) { s.setValue("asm.lines", v); }
bool getAsmFcnLines() const { return s.value("asm.fcnlines", true).toBool(); }
void setAsmFcnLines(bool v) { s.setValue("asm.fcnlines", v); }
bool getAsmEmu() const { return s.value("asm.emu", false).toBool(); } bool getAsmEmu() const { return s.value("asm.emu", false).toBool(); }
void setAsmEmu(bool v) { s.setValue("asm.emu", v); } void setAsmEmu(bool v) { s.setValue("asm.emu", v); }

View File

@ -114,7 +114,9 @@ void DisassemblerGraphView::loadCurrentGraph()
TempConfig tempConfig; TempConfig tempConfig;
tempConfig.set("scr.html", true) tempConfig.set("scr.html", true)
.set("scr.color", true) .set("scr.color", true)
.set("asm.bbline", false); .set("asm.bbline", false)
.set("asm.lines", false)
.set("asm.fcnlines", false);
QJsonDocument functionsDoc = Core()->cmdj("agJ"); QJsonDocument functionsDoc = Core()->cmdj("agJ");
QJsonArray functions = functionsDoc.array(); QJsonArray functions = functionsDoc.array();