mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Merge pull request #7658 from spycrab/debugger_show
Qt/Debugger: Add Show in Code / Show in Memory
This commit is contained in:
commit
75b8824c95
@ -229,6 +229,9 @@ void CodeViewWidget::OnContextMenu()
|
||||
auto* copy_line_action =
|
||||
menu->addAction(tr("Copy code &line"), this, &CodeViewWidget::OnCopyCode);
|
||||
auto* copy_hex_action = menu->addAction(tr("Copy &hex"), this, &CodeViewWidget::OnCopyHex);
|
||||
|
||||
menu->addAction(tr("Show in &memory"), this, &CodeViewWidget::OnShowInMemory);
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
auto* symbol_rename_action =
|
||||
@ -272,6 +275,11 @@ void CodeViewWidget::OnCopyAddress()
|
||||
QApplication::clipboard()->setText(QStringLiteral("%1").arg(addr, 8, 16, QLatin1Char('0')));
|
||||
}
|
||||
|
||||
void CodeViewWidget::OnShowInMemory()
|
||||
{
|
||||
emit ShowMemory(GetContextAddress());
|
||||
}
|
||||
|
||||
void CodeViewWidget::OnCopyCode()
|
||||
{
|
||||
const u32 addr = GetContextAddress();
|
||||
|
@ -34,8 +34,10 @@ public:
|
||||
|
||||
void ToggleBreakpoint();
|
||||
void AddBreakpoint();
|
||||
|
||||
signals:
|
||||
void RequestPPCComparison(u32 addr);
|
||||
void ShowMemory(u32 address);
|
||||
void SymbolsChanged();
|
||||
void BreakpointsChanged();
|
||||
|
||||
@ -57,6 +59,7 @@ private:
|
||||
|
||||
void OnFollowBranch();
|
||||
void OnCopyAddress();
|
||||
void OnShowInMemory();
|
||||
void OnCopyFunction();
|
||||
void OnCopyCode();
|
||||
void OnCopyHex();
|
||||
|
@ -167,6 +167,7 @@ void CodeWidget::ConnectWidgets()
|
||||
|
||||
connect(m_code_view, &CodeViewWidget::RequestPPCComparison, this,
|
||||
&CodeWidget::RequestPPCComparison);
|
||||
connect(m_code_view, &CodeViewWidget::ShowMemory, this, &CodeWidget::ShowMemory);
|
||||
}
|
||||
|
||||
void CodeWidget::OnSearchAddress()
|
||||
@ -253,6 +254,12 @@ void CodeWidget::OnSelectFunctionCallers()
|
||||
void CodeWidget::SetAddress(u32 address, CodeViewWidget::SetAddressUpdate update)
|
||||
{
|
||||
m_code_view->SetAddress(address, update);
|
||||
|
||||
if (update == CodeViewWidget::SetAddressUpdate::WithUpdate)
|
||||
{
|
||||
raise();
|
||||
m_code_view->setFocus();
|
||||
}
|
||||
}
|
||||
|
||||
void CodeWidget::Update()
|
||||
|
@ -44,6 +44,7 @@ public:
|
||||
signals:
|
||||
void BreakpointsChanged();
|
||||
void RequestPPCComparison(u32 addr);
|
||||
void ShowMemory(u32 address);
|
||||
|
||||
private:
|
||||
void CreateWidgets();
|
||||
|
@ -367,6 +367,10 @@ void MemoryViewWidget::OnContextMenu()
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(tr("Show in code"), this, [this] { emit ShowCode(GetContextAddress()); });
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(tr("Toggle Breakpoint"), this, &MemoryViewWidget::ToggleBreakpoint);
|
||||
|
||||
menu->exec(QCursor::pos());
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
|
||||
signals:
|
||||
void BreakpointsChanged();
|
||||
void ShowCode(u32 address);
|
||||
|
||||
private:
|
||||
void OnContextMenu();
|
||||
|
@ -220,6 +220,7 @@ void MemoryWidget::ConnectWidgets()
|
||||
connect(m_bp_log_check, &QCheckBox::toggled, this, &MemoryWidget::OnBPLogChanged);
|
||||
connect(m_memory_view, &MemoryViewWidget::BreakpointsChanged, this,
|
||||
&MemoryWidget::BreakpointsChanged);
|
||||
connect(m_memory_view, &MemoryViewWidget::ShowCode, this, &MemoryWidget::ShowCode);
|
||||
}
|
||||
|
||||
void MemoryWidget::closeEvent(QCloseEvent*)
|
||||
@ -338,6 +339,15 @@ void MemoryWidget::OnBPTypeChanged()
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
void MemoryWidget::SetAddress(u32 address)
|
||||
{
|
||||
m_memory_view->SetAddress(address);
|
||||
Settings::Instance().SetMemoryVisible(true);
|
||||
raise();
|
||||
|
||||
m_memory_view->setFocus();
|
||||
}
|
||||
|
||||
void MemoryWidget::OnSearchAddress()
|
||||
{
|
||||
bool good;
|
||||
|
@ -25,9 +25,11 @@ public:
|
||||
explicit MemoryWidget(QWidget* parent = nullptr);
|
||||
~MemoryWidget();
|
||||
|
||||
void SetAddress(u32 address);
|
||||
void Update();
|
||||
signals:
|
||||
void BreakpointsChanged();
|
||||
void ShowCode(u32 address);
|
||||
|
||||
private:
|
||||
void CreateWidgets();
|
||||
|
@ -361,8 +361,12 @@ void MainWindow::CreateComponents()
|
||||
connect(m_code_widget, &CodeWidget::BreakpointsChanged, m_breakpoint_widget,
|
||||
&BreakpointWidget::Update);
|
||||
connect(m_code_widget, &CodeWidget::RequestPPCComparison, m_jit_widget, &JITWidget::Compare);
|
||||
connect(m_code_widget, &CodeWidget::ShowMemory, m_memory_widget, &MemoryWidget::SetAddress);
|
||||
connect(m_memory_widget, &MemoryWidget::BreakpointsChanged, m_breakpoint_widget,
|
||||
&BreakpointWidget::Update);
|
||||
connect(m_memory_widget, &MemoryWidget::ShowCode, m_code_widget, [this](u32 address) {
|
||||
m_code_widget->SetAddress(address, CodeViewWidget::SetAddressUpdate::WithUpdate);
|
||||
});
|
||||
|
||||
connect(m_breakpoint_widget, &BreakpointWidget::BreakpointsChanged, m_code_widget,
|
||||
&CodeWidget::Update);
|
||||
|
Loading…
Reference in New Issue
Block a user