mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
MemoryView auto updateDebugger. Implement base codetrace logic. Add register breakpoints. Add CodeViewWidget autostepping to track a value.Debugger
This commit is contained in:
@ -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++)
|
||||
|
Reference in New Issue
Block a user