diff options
| author | TryTwo <taolas@gmail.com> | 2022-03-26 14:48:25 -0700 |
|---|---|---|
| committer | TryTwo <taolas@gmail.com> | 2022-10-06 22:17:22 -0700 |
| commit | fb79c04cf1aa95ed4c0d55dc840dafb16319f49b (patch) | |
| tree | 2959af7ec686607380e0b12b2a826fe3cbd8da41 /Source/Core/DolphinQt/Debugger/RegisterWidget.cpp | |
| parent | 9ca1c0f53349b3a736942ebd1f89f8e70e954a32 (diff) | |
MemoryView auto updateDebugger. Implement base codetrace logic. Add register breakpoints. Add CodeViewWidget autostepping to track a value.Debugger
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/RegisterWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/RegisterWidget.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp b/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp index 8ce8d19ca4..c671499119 100644 --- a/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp @@ -8,9 +8,11 @@ #include <QActionGroup> #include <QHeaderView> #include <QMenu> +#include <QMessageBox> #include <QTableWidget> #include <QVBoxLayout> +#include "Common/Debug/CodeTrace.h" #include "Core/Core.h" #include "Core/HW/ProcessorInterface.h" #include "Core/PowerPC/PowerPC.h" @@ -164,6 +166,16 @@ void RegisterWidget::ShowContextMenu() auto* view_double_column = menu->addAction(tr("All Double")); view_double_column->setData(static_cast<int>(RegisterDisplay::Double)); + if (type == RegisterType::gpr || type == RegisterType::fpr) + { + menu->addSeparator(); + + const std::string type_string = + fmt::format("{}{}", type == RegisterType::gpr ? "r" : "f", m_table->currentItem()->row()); + menu->addAction(tr("Run until hit (ignoring breakpoints)"), + [this, type_string]() { AutoStep(type_string); }); + } + for (auto* action : {view_hex, view_int, view_uint, view_float, view_double}) { action->setCheckable(true); @@ -269,6 +281,32 @@ void RegisterWidget::ShowContextMenu() menu->exec(QCursor::pos()); } +void RegisterWidget::AutoStep(const std::string& reg) const +{ + CodeTrace trace; + trace.SetRegTracked(reg); + + QMessageBox msgbox( + QMessageBox::NoIcon, tr("Timed Out"), + tr("<font color='#ff0000'>AutoStepping timed out. Current instruction is irrelevant."), + QMessageBox::Cancel); + QPushButton* run_button = msgbox.addButton(tr("Keep Running"), QMessageBox::AcceptRole); + + while (true) + { + const AutoStepResults results = trace.AutoStepping(true); + emit Host::GetInstance()->UpdateDisasmDialog(); + + if (!results.timed_out) + break; + + // Can keep running and try again after a time out. + msgbox.exec(); + if (msgbox.clickedButton() != (QAbstractButton*)run_button) + break; + } +} + void RegisterWidget::PopulateTable() { for (int i = 0; i < 32; i++) |
