Debugger: Add description to breakpoint dialog

This commit is contained in:
sean 2025-04-17 19:52:36 -04:00
parent a894d1575d
commit 77493f9be2
3 changed files with 42 additions and 11 deletions

View File

@ -42,6 +42,7 @@ BreakpointDialog::BreakpointDialog(QWidget* parent, DebugInterface* cpu, Breakpo
m_ui.rdoExecute->setChecked(true);
m_ui.chkEnable->setChecked(bp->enabled);
m_ui.txtAddress->setText(QtUtils::FilledQStringFromValue(bp->addr, 16));
m_ui.txtDescription->setText(QString::fromStdString(bp->description));
if (bp->hasCond)
m_ui.txtCondition->setText(QString::fromStdString(bp->cond.expressionString));
@ -53,6 +54,8 @@ BreakpointDialog::BreakpointDialog(QWidget* parent, DebugInterface* cpu, Breakpo
m_ui.txtAddress->setText(QtUtils::FilledQStringFromValue(mc->start, 16));
m_ui.txtSize->setText(QtUtils::FilledQStringFromValue(mc->end - mc->start, 16));
m_ui.txtDescription->setText(QString::fromStdString(mc->description));
m_ui.chkRead->setChecked(mc->memCond & MEMCHECK_READ);
m_ui.chkWrite->setChecked(mc->memCond & MEMCHECK_WRITE);
m_ui.chkChange->setChecked(mc->memCond & MEMCHECK_WRITE_ONCHANGE);
@ -102,6 +105,7 @@ void BreakpointDialog::accept()
}
bp->addr = address;
bp->description = m_ui.txtDescription->text().toStdString();
bp->enabled = m_ui.chkEnable->isChecked();
@ -138,6 +142,7 @@ void BreakpointDialog::accept()
mc->start = startAddress;
mc->end = startAddress + size;
mc->description = m_ui.txtDescription->text().toStdString();
if (!m_ui.txtCondition->text().isEmpty())
{

View File

@ -10,7 +10,7 @@
<x>0</x>
<y>0</y>
<width>375</width>
<height>250</height>
<height>300</height>
</rect>
</property>
<property name="sizePolicy">
@ -22,19 +22,19 @@
<property name="minimumSize">
<size>
<width>375</width>
<height>250</height>
<height>300</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>375</width>
<height>250</height>
<height>300</height>
</size>
</property>
<property name="baseSize">
<size>
<width>375</width>
<height>250</height>
<height>300</height>
</size>
</property>
<property name="windowTitle">
@ -44,7 +44,7 @@
<property name="geometry">
<rect>
<x>20</x>
<y>210</y>
<y>260</y>
<width>341</width>
<height>32</height>
</rect>
@ -102,14 +102,17 @@
<rect>
<x>110</x>
<y>10</y>
<width>251</width>
<height>41</height>
<width>250</width>
<height>79</height>
</rect>
</property>
<property name="title">
<string/>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="formAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
@ -139,6 +142,29 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Description</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="txtDescription">
<property name="minimumSize">
<size>
<width>0</width>
<height>19</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>19</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="grpMemory">
@ -148,7 +174,7 @@
<property name="geometry">
<rect>
<x>110</x>
<y>50</y>
<y>100</y>
<width>251</width>
<height>91</height>
</rect>
@ -224,13 +250,13 @@
<property name="geometry">
<rect>
<x>110</x>
<y>140</y>
<y>190</y>
<width>251</width>
<height>61</height>
</rect>
</property>
<property name="title">
<string></string>
<string/>
</property>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">

View File

@ -63,7 +63,7 @@ void DebuggerSettingsManager::loadGameSettings(BreakpointModel* bpModel)
}
// Breakpoint descriptions were added at debugger settings file version 0.01. If loading
// saved breakpoints from a previous version (only 0.00 exists), the breakpoints will be
// saved breakpoints from a previous version (only 0.00 existed prior), the breakpoints will be
// missing a description. This code will add in an empty description so that the previous
// version, 0.00, is compatible with 0.01.
const QJsonValue savedVersionValue = loadGameSettingsJSON().value("Version");