diff --git a/Source/Core/DolphinQt2/Debugger/RegisterWidget.cpp b/Source/Core/DolphinQt2/Debugger/RegisterWidget.cpp index e9817b84ff..08e5ba3168 100644 --- a/Source/Core/DolphinQt2/Debugger/RegisterWidget.cpp +++ b/Source/Core/DolphinQt2/Debugger/RegisterWidget.cpp @@ -117,7 +117,8 @@ void RegisterWidget::ShowContextMenu() auto type = static_cast(item->data(DATA_TYPE).toInt()); auto display = item->GetDisplay(); - menu->addAction(tr("Add to &watch")); + AddAction(menu, tr("Add to &watch"), this, + [this, item] { emit RequestMemoryBreakpoint(item->GetValue()); }); menu->addAction(tr("View &memory")); menu->addAction(tr("View &code")); diff --git a/Source/Core/DolphinQt2/Debugger/RegisterWidget.h b/Source/Core/DolphinQt2/Debugger/RegisterWidget.h index 3793e12e6e..f5c1a4c1a1 100644 --- a/Source/Core/DolphinQt2/Debugger/RegisterWidget.h +++ b/Source/Core/DolphinQt2/Debugger/RegisterWidget.h @@ -23,6 +23,7 @@ public: signals: void RequestTableUpdate(); + void RequestMemoryBreakpoint(u32 addr); void UpdateTable(); void UpdateValue(QTableWidgetItem* item); void UpdateValueType(QTableWidgetItem* item); diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp index 6e20544770..a425d8891e 100644 --- a/Source/Core/DolphinQt2/MainWindow.cpp +++ b/Source/Core/DolphinQt2/MainWindow.cpp @@ -1,3 +1,4 @@ + // Copyright 2015 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. @@ -46,10 +47,10 @@ #include "DolphinQt2/Config/LogWidget.h" #include "DolphinQt2/Config/Mapping/MappingWindow.h" #include "DolphinQt2/Config/SettingsWindow.h" -#include "DolphinQt2/FIFOPlayerWindow.h" #include "DolphinQt2/Debugger/BreakpointWidget.h" #include "DolphinQt2/Debugger/RegisterWidget.h" #include "DolphinQt2/Debugger/WatchWidget.h" +#include "DolphinQt2/FIFOPlayerWindow.h" #include "DolphinQt2/Host.h" #include "DolphinQt2/HotkeyScheduler.h" #include "DolphinQt2/MainWindow.h" @@ -175,6 +176,11 @@ void MainWindow::CreateComponents() m_watch_widget = new WatchWidget(this); m_breakpoint_widget = new BreakpointWidget(this); + connect(m_watch_widget, &WatchWidget::RequestMemoryBreakpoint, + [this](u32 addr) { m_breakpoint_widget->AddAddressMBP(addr); }); + connect(m_register_widget, &RegisterWidget::RequestMemoryBreakpoint, + [this](u32 addr) { m_breakpoint_widget->AddAddressMBP(addr); }); + #if defined(HAVE_XRANDR) && HAVE_XRANDR m_graphics_window = new GraphicsWindow( new X11Utils::XRRConfiguration(