mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-16 11:48:36 +12:00
Qt: some cleanup in debugger
This commit is contained in:
parent
b3fb6d7d18
commit
ba45daff35
13 changed files with 82 additions and 96 deletions
|
@ -479,7 +479,7 @@ static bool ppu_break(ppu_thread& ppu, ppu_opcode_t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set or remove breakpoint
|
// Set or remove breakpoint
|
||||||
extern void ppu_breakpoint(u32 addr, bool isAdding)
|
extern void ppu_breakpoint(u32 addr, bool is_adding)
|
||||||
{
|
{
|
||||||
if (g_cfg.core.ppu_decoder == ppu_decoder_type::llvm)
|
if (g_cfg.core.ppu_decoder == ppu_decoder_type::llvm)
|
||||||
{
|
{
|
||||||
|
@ -488,7 +488,7 @@ extern void ppu_breakpoint(u32 addr, bool isAdding)
|
||||||
|
|
||||||
const u64 _break = reinterpret_cast<uptr>(&ppu_break);
|
const u64 _break = reinterpret_cast<uptr>(&ppu_break);
|
||||||
|
|
||||||
if (isAdding)
|
if (is_adding)
|
||||||
{
|
{
|
||||||
// Set breakpoint
|
// Set breakpoint
|
||||||
ppu_ref(addr) = _break;
|
ppu_ref(addr) = _break;
|
||||||
|
|
|
@ -19,14 +19,14 @@ auto_pause_settings_dialog::auto_pause_settings_dialog(QWidget *parent) : QDialo
|
||||||
{
|
{
|
||||||
QLabel *description = new QLabel(tr("To use auto pause: enter the ID(s) of a function or a system call.\nRestart of the game is required to apply. You can enable/disable this in the settings."), this);
|
QLabel *description = new QLabel(tr("To use auto pause: enter the ID(s) of a function or a system call.\nRestart of the game is required to apply. You can enable/disable this in the settings."), this);
|
||||||
|
|
||||||
pauseList = new QTableWidget(this);
|
m_pause_list = new QTableWidget(this);
|
||||||
pauseList->setColumnCount(2);
|
m_pause_list->setColumnCount(2);
|
||||||
pauseList->setHorizontalHeaderLabels(QStringList() << tr("Call ID") << tr("Type"));
|
m_pause_list->setHorizontalHeaderLabels(QStringList() << tr("Call ID") << tr("Type"));
|
||||||
//pauseList->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
//m_pause_list->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||||
pauseList->setSelectionBehavior(QAbstractItemView::SelectRows);
|
m_pause_list->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
pauseList->setContextMenuPolicy(Qt::CustomContextMenu);
|
m_pause_list->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
pauseList->setItemDelegate(new table_item_delegate(this));
|
m_pause_list->setItemDelegate(new table_item_delegate(this));
|
||||||
pauseList->setShowGrid(false);
|
m_pause_list->setShowGrid(false);
|
||||||
|
|
||||||
QPushButton *clearButton = new QPushButton(tr("Clear"), this);
|
QPushButton *clearButton = new QPushButton(tr("Clear"), this);
|
||||||
QPushButton *reloadButton = new QPushButton(tr("Reload"), this);
|
QPushButton *reloadButton = new QPushButton(tr("Reload"), this);
|
||||||
|
@ -43,7 +43,7 @@ auto_pause_settings_dialog::auto_pause_settings_dialog(QWidget *parent) : QDialo
|
||||||
|
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
||||||
mainLayout->addWidget(description);
|
mainLayout->addWidget(description);
|
||||||
mainLayout->addWidget(pauseList);
|
mainLayout->addWidget(m_pause_list);
|
||||||
mainLayout->addLayout(buttonsLayout);
|
mainLayout->addLayout(buttonsLayout);
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ auto_pause_settings_dialog::auto_pause_settings_dialog(QWidget *parent) : QDialo
|
||||||
setObjectName("auto_pause_manager");
|
setObjectName("auto_pause_manager");
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
connect(pauseList, &QTableWidget::customContextMenuRequested, this, &auto_pause_settings_dialog::ShowContextMenu);
|
connect(m_pause_list, &QTableWidget::customContextMenuRequested, this, &auto_pause_settings_dialog::ShowContextMenu);
|
||||||
connect(clearButton, &QAbstractButton::clicked, [this](){ m_entries.clear(); UpdateList(); });
|
connect(clearButton, &QAbstractButton::clicked, [this](){ m_entries.clear(); UpdateList(); });
|
||||||
connect(reloadButton, &QAbstractButton::clicked, [this](){ LoadEntries(); UpdateList(); });
|
connect(reloadButton, &QAbstractButton::clicked, [this](){ LoadEntries(); UpdateList(); });
|
||||||
connect(saveButton, &QAbstractButton::clicked, [this]()
|
connect(saveButton, &QAbstractButton::clicked, [this]()
|
||||||
|
@ -118,8 +118,8 @@ void auto_pause_settings_dialog::SaveEntries(void)
|
||||||
void auto_pause_settings_dialog::UpdateList(void)
|
void auto_pause_settings_dialog::UpdateList(void)
|
||||||
{
|
{
|
||||||
const int entries_size = static_cast<int>(m_entries.size());
|
const int entries_size = static_cast<int>(m_entries.size());
|
||||||
pauseList->clearContents();
|
m_pause_list->clearContents();
|
||||||
pauseList->setRowCount(entries_size);
|
m_pause_list->setRowCount(entries_size);
|
||||||
for (int i = 0; i < entries_size; ++i)
|
for (int i = 0; i < entries_size; ++i)
|
||||||
{
|
{
|
||||||
QTableWidgetItem* callItem = new QTableWidgetItem;
|
QTableWidgetItem* callItem = new QTableWidgetItem;
|
||||||
|
@ -144,14 +144,14 @@ void auto_pause_settings_dialog::UpdateList(void)
|
||||||
typeItem->setData(Qt::DisplayRole, tr("Function Call"));
|
typeItem->setData(Qt::DisplayRole, tr("Function Call"));
|
||||||
}
|
}
|
||||||
|
|
||||||
pauseList->setItem(i, 0, callItem);
|
m_pause_list->setItem(i, 0, callItem);
|
||||||
pauseList->setItem(i, 1, typeItem);
|
m_pause_list->setItem(i, 1, typeItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void auto_pause_settings_dialog::ShowContextMenu(const QPoint &pos)
|
void auto_pause_settings_dialog::ShowContextMenu(const QPoint &pos)
|
||||||
{
|
{
|
||||||
const int row = pauseList->indexAt(pos).row();
|
const int row = m_pause_list->indexAt(pos).row();
|
||||||
|
|
||||||
QMenu myMenu;
|
QMenu myMenu;
|
||||||
|
|
||||||
|
@ -175,22 +175,23 @@ void auto_pause_settings_dialog::ShowContextMenu(const QPoint &pos)
|
||||||
UpdateList();
|
UpdateList();
|
||||||
};
|
};
|
||||||
|
|
||||||
connect(add, &QAction::triggered, [=, this]() {
|
connect(add, &QAction::triggered, this, [=, this]()
|
||||||
|
{
|
||||||
m_entries.emplace_back(0xFFFFFFFF);
|
m_entries.emplace_back(0xFFFFFFFF);
|
||||||
UpdateList();
|
UpdateList();
|
||||||
int idx = static_cast<int>(m_entries.size()) - 1;
|
int idx = static_cast<int>(m_entries.size()) - 1;
|
||||||
pauseList->selectRow(idx);
|
m_pause_list->selectRow(idx);
|
||||||
OnEntryConfig(idx, true);
|
OnEntryConfig(idx, true);
|
||||||
});
|
});
|
||||||
connect(remove, &QAction::triggered, this, &auto_pause_settings_dialog::OnRemove);
|
connect(remove, &QAction::triggered, this, &auto_pause_settings_dialog::OnRemove);
|
||||||
connect(config, &QAction::triggered, [=, this]() {OnEntryConfig(row, false); });
|
connect(config, &QAction::triggered, this, [=, this]() {OnEntryConfig(row, false); });
|
||||||
|
|
||||||
myMenu.exec(pauseList->viewport()->mapToGlobal(pos));
|
myMenu.exec(m_pause_list->viewport()->mapToGlobal(pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
void auto_pause_settings_dialog::OnRemove()
|
void auto_pause_settings_dialog::OnRemove()
|
||||||
{
|
{
|
||||||
QModelIndexList selection = pauseList->selectionModel()->selectedRows();
|
QModelIndexList selection = m_pause_list->selectionModel()->selectedRows();
|
||||||
std::sort(selection.begin(), selection.end());
|
std::sort(selection.begin(), selection.end());
|
||||||
for (int i = selection.count() - 1; i >= 0; i--)
|
for (int i = selection.count() - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,10 +20,10 @@ class auto_pause_settings_dialog : public QDialog
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<u32> m_entries;
|
std::vector<u32> m_entries;
|
||||||
|
QTableWidget *m_pause_list;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit auto_pause_settings_dialog(QWidget* parent);
|
explicit auto_pause_settings_dialog(QWidget* parent);
|
||||||
QTableWidget *pauseList;
|
|
||||||
void UpdateList(void);
|
void UpdateList(void);
|
||||||
void LoadEntries(void);
|
void LoadEntries(void);
|
||||||
void SaveEntries(void);
|
void SaveEntries(void);
|
||||||
|
|
|
@ -1,20 +1,18 @@
|
||||||
#include "breakpoint_handler.h"
|
#include "breakpoint_handler.h"
|
||||||
|
|
||||||
extern void ppu_breakpoint(u32 loc, bool isAdding);
|
extern void ppu_breakpoint(u32 loc, bool is_adding);
|
||||||
|
|
||||||
breakpoint_handler::breakpoint_handler() :m_breakpoints()
|
breakpoint_handler::breakpoint_handler()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
breakpoint_handler::~breakpoint_handler()
|
breakpoint_handler::~breakpoint_handler()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool breakpoint_handler::HasBreakpoint(u32 loc) const
|
bool breakpoint_handler::HasBreakpoint(u32 loc) const
|
||||||
{
|
{
|
||||||
return m_breakpoints.find(loc) != m_breakpoints.end();
|
return m_breakpoints.contains(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool breakpoint_handler::AddBreakpoint(u32 loc)
|
bool breakpoint_handler::AddBreakpoint(u32 loc)
|
||||||
|
|
|
@ -31,7 +31,6 @@ public:
|
||||||
*/
|
*/
|
||||||
bool AddBreakpoint(u32 loc);
|
bool AddBreakpoint(u32 loc);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if removed breakpoint at loc successfully.
|
* Returns true if removed breakpoint at loc successfully.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -64,17 +64,14 @@ void breakpoint_list::AddBreakpoint(u32 pc)
|
||||||
|
|
||||||
m_disasm->disasm(pc);
|
m_disasm->disasm(pc);
|
||||||
|
|
||||||
QString breakpointItemText = qstr(m_disasm->last_opcode);
|
QString text = qstr(m_disasm->last_opcode);
|
||||||
|
text.remove(10, 13);
|
||||||
|
|
||||||
breakpointItemText.remove(10, 13);
|
QListWidgetItem* breakpoint_item = new QListWidgetItem(text);
|
||||||
|
breakpoint_item->setForeground(m_text_color_bp);
|
||||||
QListWidgetItem* breakpointItem = new QListWidgetItem(breakpointItemText);
|
breakpoint_item->setBackground(m_color_bp);
|
||||||
breakpointItem->setForeground(m_text_color_bp);
|
breakpoint_item->setData(Qt::UserRole, pc);
|
||||||
breakpointItem->setBackground(m_color_bp);
|
addItem(breakpoint_item);
|
||||||
QVariant pcVariant;
|
|
||||||
pcVariant.setValue(pc);
|
|
||||||
breakpointItem->setData(Qt::UserRole, pcVariant);
|
|
||||||
addItem(breakpointItem);
|
|
||||||
|
|
||||||
Q_EMIT RequestShowAddress(pc);
|
Q_EMIT RequestShowAddress(pc);
|
||||||
}
|
}
|
||||||
|
@ -102,7 +99,7 @@ void breakpoint_list::HandleBreakpointRequest(u32 loc)
|
||||||
|
|
||||||
void breakpoint_list::OnBreakpointListDoubleClicked()
|
void breakpoint_list::OnBreakpointListDoubleClicked()
|
||||||
{
|
{
|
||||||
u32 address = currentItem()->data(Qt::UserRole).value<u32>();
|
const u32 address = currentItem()->data(Qt::UserRole).value<u32>();
|
||||||
Q_EMIT RequestShowAddress(address);
|
Q_EMIT RequestShowAddress(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,36 +114,28 @@ void breakpoint_list::OnBreakpointListRightClicked(const QPoint &pos)
|
||||||
|
|
||||||
if (selectedItems().count() == 1)
|
if (selectedItems().count() == 1)
|
||||||
{
|
{
|
||||||
menu->addAction("Rename");
|
QAction* rename_action = menu->addAction(tr("&Rename"));
|
||||||
|
connect(rename_action, &QAction::triggered, this, [this]()
|
||||||
|
{
|
||||||
|
QListWidgetItem* current_item = selectedItems().first();
|
||||||
|
current_item->setFlags(current_item->flags() | Qt::ItemIsEditable);
|
||||||
|
editItem(current_item);
|
||||||
|
});
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction* m_breakpoint_list_delete = new QAction("Delete", this);
|
QAction* delete_action = new QAction(tr("&Delete"), this);
|
||||||
m_breakpoint_list_delete->setShortcut(Qt::Key_Delete);
|
delete_action->setShortcut(Qt::Key_Delete);
|
||||||
m_breakpoint_list_delete->setShortcutContext(Qt::WidgetShortcut);
|
delete_action->setShortcutContext(Qt::WidgetShortcut);
|
||||||
addAction(m_breakpoint_list_delete);
|
connect(delete_action, &QAction::triggered, this, &breakpoint_list::OnBreakpointListDelete);
|
||||||
connect(m_breakpoint_list_delete, &QAction::triggered, this, &breakpoint_list::OnBreakpointListDelete);
|
menu->addAction(delete_action);
|
||||||
|
|
||||||
menu->addAction(m_breakpoint_list_delete);
|
menu->exec(viewport()->mapToGlobal(pos));
|
||||||
|
|
||||||
QAction* selectedItem = menu->exec(viewport()->mapToGlobal(pos));
|
|
||||||
if (selectedItem)
|
|
||||||
{
|
|
||||||
if (selectedItem->text() == "Rename")
|
|
||||||
{
|
|
||||||
QListWidgetItem* currentItem = selectedItems().at(0);
|
|
||||||
|
|
||||||
currentItem->setFlags(currentItem->flags() | Qt::ItemIsEditable);
|
|
||||||
editItem(currentItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void breakpoint_list::OnBreakpointListDelete()
|
void breakpoint_list::OnBreakpointListDelete()
|
||||||
{
|
{
|
||||||
int selectedCount = selectedItems().count();
|
for (int i = selectedItems().count() - 1; i >= 0; i--)
|
||||||
|
|
||||||
for (int i = selectedCount - 1; i >= 0; i--)
|
|
||||||
{
|
{
|
||||||
RemoveBreakpoint(item(i)->data(Qt::UserRole).value<u32>());
|
RemoveBreakpoint(item(i)->data(Qt::UserRole).value<u32>());
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,10 @@ void call_stack_list::HandleUpdate(std::vector<std::pair<u32, u32>> call_stack)
|
||||||
|
|
||||||
for (const auto& addr : call_stack)
|
for (const auto& addr : call_stack)
|
||||||
{
|
{
|
||||||
const QString call_stack_item_text = qstr(fmt::format("0x%08llx (sp=0x%08llx)", addr.first, addr.second));
|
const QString text = qstr(fmt::format("0x%08llx (sp=0x%08llx)", addr.first, addr.second));
|
||||||
QListWidgetItem* callStackItem = new QListWidgetItem(call_stack_item_text);
|
QListWidgetItem* call_stack_item = new QListWidgetItem(text);
|
||||||
callStackItem->setData(Qt::UserRole, { addr.first });
|
call_stack_item->setData(Qt::UserRole, { addr.first });
|
||||||
addItem(callStackItem);
|
addItem(call_stack_item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#include "util/types.hpp"
|
#include "util/types.hpp"
|
||||||
|
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
#include <memory>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class cpu_thread;
|
class cpu_thread;
|
||||||
|
|
|
@ -16,7 +16,8 @@ LOG_CHANNEL(gui_log, "GUI");
|
||||||
constexpr auto qstr = QString::fromStdString;
|
constexpr auto qstr = QString::fromStdString;
|
||||||
inline std::string sstr(const QString& _in) { return _in.toStdString(); }
|
inline std::string sstr(const QString& _in) { return _in.toStdString(); }
|
||||||
|
|
||||||
cg_disasm_window::cg_disasm_window(std::shared_ptr<gui_settings> xSettings): xgui_settings(xSettings)
|
cg_disasm_window::cg_disasm_window(std::shared_ptr<gui_settings> xSettings)
|
||||||
|
: m_gui_settings(xSettings)
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("Cg Disasm"));
|
setWindowTitle(tr("Cg Disasm"));
|
||||||
setObjectName("cg_disasm");
|
setObjectName("cg_disasm");
|
||||||
|
@ -26,7 +27,7 @@ cg_disasm_window::cg_disasm_window(std::shared_ptr<gui_settings> xSettings): xgu
|
||||||
setMinimumSize(QSize(200, 150)); // seems fine on win 10
|
setMinimumSize(QSize(200, 150)); // seems fine on win 10
|
||||||
resize(QSize(620, 395));
|
resize(QSize(620, 395));
|
||||||
|
|
||||||
m_path_last = xgui_settings->GetValue(gui::fd_cg_disasm).toString();
|
m_path_last = m_gui_settings->GetValue(gui::fd_cg_disasm).toString();
|
||||||
|
|
||||||
m_disasm_text = new QTextEdit(this);
|
m_disasm_text = new QTextEdit(this);
|
||||||
m_disasm_text->setReadOnly(true);
|
m_disasm_text->setReadOnly(true);
|
||||||
|
@ -114,7 +115,7 @@ void cg_disasm_window::ShowDisasm()
|
||||||
disasm.BuildShaderBody();
|
disasm.BuildShaderBody();
|
||||||
m_disasm_text->setText(qstr(disasm.GetArbShader()));
|
m_disasm_text->setText(qstr(disasm.GetArbShader()));
|
||||||
m_glsl_text->setText(qstr(disasm.GetGlslShader()));
|
m_glsl_text->setText(qstr(disasm.GetGlslShader()));
|
||||||
xgui_settings->SetValue(gui::fd_cg_disasm, m_path_last);
|
m_gui_settings->SetValue(gui::fd_cg_disasm, m_path_last);
|
||||||
}
|
}
|
||||||
else if (!m_path_last.isEmpty())
|
else if (!m_path_last.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,9 +26,7 @@ private:
|
||||||
QTextEdit* m_disasm_text;
|
QTextEdit* m_disasm_text;
|
||||||
QTextEdit* m_glsl_text;
|
QTextEdit* m_glsl_text;
|
||||||
|
|
||||||
QAction *openCgBinaryProgram;
|
std::shared_ptr<gui_settings> m_gui_settings;
|
||||||
|
|
||||||
std::shared_ptr<gui_settings> xgui_settings;
|
|
||||||
|
|
||||||
AsmHighlighter* sh_asm;
|
AsmHighlighter* sh_asm;
|
||||||
GlslHighlighter* sh_glsl;
|
GlslHighlighter* sh_glsl;
|
||||||
|
|
|
@ -21,7 +21,7 @@ constexpr auto qstr = QString::fromStdString;
|
||||||
|
|
||||||
debugger_list::debugger_list(QWidget* parent, std::shared_ptr<gui_settings> settings, breakpoint_handler* handler)
|
debugger_list::debugger_list(QWidget* parent, std::shared_ptr<gui_settings> settings, breakpoint_handler* handler)
|
||||||
: QListWidget(parent)
|
: QListWidget(parent)
|
||||||
, xgui_settings(settings)
|
, m_gui_settings(settings)
|
||||||
, m_breakpoint_handler(handler)
|
, m_breakpoint_handler(handler)
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("ASM"));
|
setWindowTitle(tr("ASM"));
|
||||||
|
@ -50,7 +50,7 @@ void debugger_list::ShowAddress(u32 addr, bool force)
|
||||||
return m_cpu && m_cpu->id_type() == 1 && m_breakpoint_handler->HasBreakpoint(pc);
|
return m_cpu && m_cpu->id_type() == 1 && m_breakpoint_handler->HasBreakpoint(pc);
|
||||||
};
|
};
|
||||||
|
|
||||||
bool center_pc = xgui_settings->GetValue(gui::d_centerPC).toBool();
|
bool center_pc = m_gui_settings->GetValue(gui::d_centerPC).toBool();
|
||||||
|
|
||||||
// How many spaces addr can move down without us needing to move the entire view
|
// How many spaces addr can move down without us needing to move the entire view
|
||||||
const u32 addr_margin = (m_item_count / (center_pc ? 2 : 1) - 4); // 4 is just a buffer of 4 spaces at the bottom
|
const u32 addr_margin = (m_item_count / (center_pc ? 2 : 1) - 4); // 4 is just a buffer of 4 spaces at the bottom
|
||||||
|
@ -74,16 +74,17 @@ void debugger_list::ShowAddress(u32 addr, bool force)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto default_foreground = palette().color(foregroundRole());
|
const auto& default_foreground = palette().color(foregroundRole());
|
||||||
const auto default_background = palette().color(backgroundRole());
|
const auto& default_background = palette().color(backgroundRole());
|
||||||
|
|
||||||
if (!m_cpu || !m_disasm || +m_cpu->state + cpu_flag::exit + cpu_flag::wait == +m_cpu->state)
|
if (!m_cpu || !m_disasm || +m_cpu->state + cpu_flag::exit + cpu_flag::wait == +m_cpu->state)
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < m_item_count; ++i)
|
for (uint i = 0; i < m_item_count; ++i)
|
||||||
{
|
{
|
||||||
item(i)->setText(qstr(fmt::format(" [%08x] ?? ?? ?? ??:", 0)));
|
QListWidgetItem* list_item = item(i);
|
||||||
item(i)->setForeground(default_foreground);
|
list_item->setText(qstr(fmt::format(" [%08x] ?? ?? ?? ??:", 0)));
|
||||||
item(i)->setBackground(default_background);
|
list_item->setForeground(default_foreground);
|
||||||
|
list_item->setBackground(default_background);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -93,27 +94,29 @@ void debugger_list::ShowAddress(u32 addr, bool force)
|
||||||
m_pc &= address_limits;
|
m_pc &= address_limits;
|
||||||
u32 pc = m_pc;
|
u32 pc = m_pc;
|
||||||
|
|
||||||
for (uint i = 0, count = 4; i<m_item_count; ++i, pc = (pc + count) & address_limits)
|
for (uint i = 0, count = 4; i < m_item_count; ++i, pc = (pc + count) & address_limits)
|
||||||
{
|
{
|
||||||
|
QListWidgetItem* list_item = item(i);
|
||||||
|
|
||||||
if (m_cpu->is_paused() && pc == m_cpu->get_pc())
|
if (m_cpu->is_paused() && pc == m_cpu->get_pc())
|
||||||
{
|
{
|
||||||
item(i)->setForeground(m_text_color_pc);
|
list_item->setForeground(m_text_color_pc);
|
||||||
item(i)->setBackground(m_color_pc);
|
list_item->setBackground(m_color_pc);
|
||||||
}
|
}
|
||||||
else if (IsBreakpoint(pc))
|
else if (IsBreakpoint(pc))
|
||||||
{
|
{
|
||||||
item(i)->setForeground(m_text_color_bp);
|
list_item->setForeground(m_text_color_bp);
|
||||||
item(i)->setBackground(m_color_bp);
|
list_item->setBackground(m_color_bp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item(i)->setForeground(default_foreground);
|
list_item->setForeground(default_foreground);
|
||||||
item(i)->setBackground(default_background);
|
list_item->setBackground(default_background);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_cpu->id_type() == 1 && !vm::check_addr(pc, 0))
|
if (m_cpu->id_type() == 1 && !vm::check_addr(pc, 0))
|
||||||
{
|
{
|
||||||
item(i)->setText((IsBreakpoint(pc) ? ">> " : " ") + qstr(fmt::format("[%08x] ?? ?? ?? ??:", pc)));
|
list_item->setText((IsBreakpoint(pc) ? ">> " : " ") + qstr(fmt::format("[%08x] ?? ?? ?? ??:", pc)));
|
||||||
count = 4;
|
count = 4;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -121,7 +124,7 @@ void debugger_list::ShowAddress(u32 addr, bool force)
|
||||||
if (m_cpu->id_type() == 1 && !vm::check_addr(pc, vm::page_executable))
|
if (m_cpu->id_type() == 1 && !vm::check_addr(pc, vm::page_executable))
|
||||||
{
|
{
|
||||||
const u32 data = *vm::get_super_ptr<atomic_be_t<u32>>(pc);
|
const u32 data = *vm::get_super_ptr<atomic_be_t<u32>>(pc);
|
||||||
item(i)->setText((IsBreakpoint(pc) ? ">> " : " ") + qstr(fmt::format("[%08x] %02x %02x %02x %02x:", pc,
|
list_item->setText((IsBreakpoint(pc) ? ">> " : " ") + qstr(fmt::format("[%08x] %02x %02x %02x %02x:", pc,
|
||||||
static_cast<u8>(data >> 24),
|
static_cast<u8>(data >> 24),
|
||||||
static_cast<u8>(data >> 16),
|
static_cast<u8>(data >> 16),
|
||||||
static_cast<u8>(data >> 8),
|
static_cast<u8>(data >> 8),
|
||||||
|
@ -134,12 +137,12 @@ void debugger_list::ShowAddress(u32 addr, bool force)
|
||||||
|
|
||||||
if (!count)
|
if (!count)
|
||||||
{
|
{
|
||||||
item(i)->setText((IsBreakpoint(pc) ? ">> " : " ") + qstr(fmt::format("[%08x] ??? ?? ??", pc)));
|
list_item->setText((IsBreakpoint(pc) ? ">> " : " ") + qstr(fmt::format("[%08x] ??? ?? ??", pc)));
|
||||||
count = 4;
|
count = 4;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
item(i)->setText((IsBreakpoint(pc) ? ">> " : " ") + qstr(m_disasm->last_opcode));
|
list_item->setText((IsBreakpoint(pc) ? ">> " : " ") + qstr(m_disasm->last_opcode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +253,7 @@ void debugger_list::mouseDoubleClickEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton)
|
if (event->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
int i = currentRow();
|
const int i = currentRow();
|
||||||
if (i < 0) return;
|
if (i < 0) return;
|
||||||
|
|
||||||
const u32 pc = m_pc + i * 4;
|
const u32 pc = m_pc + i * 4;
|
||||||
|
@ -264,7 +267,7 @@ void debugger_list::mouseDoubleClickEvent(QMouseEvent* event)
|
||||||
|
|
||||||
void debugger_list::wheelEvent(QWheelEvent* event)
|
void debugger_list::wheelEvent(QWheelEvent* event)
|
||||||
{
|
{
|
||||||
const QPoint numSteps = event->angleDelta() / 8 / 15; // http://doc.qt.io/qt-5/qwheelevent.html#pixelDelta
|
const QPoint numSteps = event->angleDelta() / 8 / 15; // http://doc.qt.io/qt-5/qwheelevent.html#pixelDelta
|
||||||
const int value = numSteps.y();
|
const int value = numSteps.y();
|
||||||
const auto direction = (event->modifiers() == Qt::ControlModifier);
|
const auto direction = (event->modifiers() == Qt::ControlModifier);
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ private:
|
||||||
*/
|
*/
|
||||||
u32 GetCenteredAddress(u32 address) const;
|
u32 GetCenteredAddress(u32 address) const;
|
||||||
|
|
||||||
std::shared_ptr<gui_settings> xgui_settings;
|
std::shared_ptr<gui_settings> m_gui_settings;
|
||||||
|
|
||||||
breakpoint_handler* m_breakpoint_handler;
|
breakpoint_handler* m_breakpoint_handler;
|
||||||
cpu_thread* m_cpu = nullptr;
|
cpu_thread* m_cpu = nullptr;
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
class CPUDisAsm;
|
class CPUDisAsm;
|
||||||
class cpu_thread;
|
class cpu_thread;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue