summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/citra_qt/CMakeLists.txt2
-rw-r--r--src/citra_qt/debugger/graphics_breakpoint_observer.cpp32
-rw-r--r--src/citra_qt/debugger/graphics_breakpoint_observer.h33
-rw-r--r--src/citra_qt/debugger/graphics_framebuffer.cpp27
-rw-r--r--src/citra_qt/debugger/graphics_framebuffer.h24
5 files changed, 68 insertions, 50 deletions
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt
index bbc521f8a..dbeb7c4c0 100644
--- a/src/citra_qt/CMakeLists.txt
+++ b/src/citra_qt/CMakeLists.txt
@@ -8,6 +8,7 @@ set(SRCS
8 debugger/callstack.cpp 8 debugger/callstack.cpp
9 debugger/disassembler.cpp 9 debugger/disassembler.cpp
10 debugger/graphics.cpp 10 debugger/graphics.cpp
11 debugger/graphics_breakpoint_observer.cpp
11 debugger/graphics_breakpoints.cpp 12 debugger/graphics_breakpoints.cpp
12 debugger/graphics_cmdlists.cpp 13 debugger/graphics_cmdlists.cpp
13 debugger/graphics_framebuffer.cpp 14 debugger/graphics_framebuffer.cpp
@@ -27,6 +28,7 @@ set(HEADERS
27 debugger/callstack.h 28 debugger/callstack.h
28 debugger/disassembler.h 29 debugger/disassembler.h
29 debugger/graphics.h 30 debugger/graphics.h
31 debugger/graphics_breakpoint_observer.h
30 debugger/graphics_breakpoints.h 32 debugger/graphics_breakpoints.h
31 debugger/graphics_breakpoints_p.h 33 debugger/graphics_breakpoints_p.h
32 debugger/graphics_cmdlists.h 34 debugger/graphics_cmdlists.h
diff --git a/src/citra_qt/debugger/graphics_breakpoint_observer.cpp b/src/citra_qt/debugger/graphics_breakpoint_observer.cpp
new file mode 100644
index 000000000..10ac1ebad
--- /dev/null
+++ b/src/citra_qt/debugger/graphics_breakpoint_observer.cpp
@@ -0,0 +1,32 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <QMetaType>
6
7#include "graphics_breakpoint_observer.h"
8
9BreakPointObserverDock::BreakPointObserverDock(std::shared_ptr<Pica::DebugContext> debug_context,
10 const QString& title, QWidget* parent)
11 : QDockWidget(title, parent), BreakPointObserver(debug_context)
12{
13 qRegisterMetaType<Pica::DebugContext::Event>("Pica::DebugContext::Event");
14
15 connect(this, SIGNAL(Resumed()), this, SLOT(OnResumed()));
16
17 // NOTE: This signal is emitted from a non-GUI thread, but connect() takes
18 // care of delaying its handling to the GUI thread.
19 connect(this, SIGNAL(BreakPointHit(Pica::DebugContext::Event,void*)),
20 this, SLOT(OnBreakPointHit(Pica::DebugContext::Event,void*)),
21 Qt::BlockingQueuedConnection);
22}
23
24void BreakPointObserverDock::OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data)
25{
26 emit BreakPointHit(event, data);
27}
28
29void BreakPointObserverDock::OnPicaResume()
30{
31 emit Resumed();
32}
diff --git a/src/citra_qt/debugger/graphics_breakpoint_observer.h b/src/citra_qt/debugger/graphics_breakpoint_observer.h
new file mode 100644
index 000000000..f0d3361f8
--- /dev/null
+++ b/src/citra_qt/debugger/graphics_breakpoint_observer.h
@@ -0,0 +1,33 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <QDockWidget>
8
9#include "video_core/debug_utils/debug_utils.h"
10
11/**
12 * Utility class which forwards calls to OnPicaBreakPointHit and OnPicaResume to public slots.
13 * This is because the Pica breakpoint callbacks are called from a non-GUI thread, while
14 * the widget usually wants to perform reactions in the GUI thread.
15 */
16class BreakPointObserverDock : public QDockWidget, private Pica::DebugContext::BreakPointObserver {
17 Q_OBJECT
18
19public:
20 BreakPointObserverDock(std::shared_ptr<Pica::DebugContext> debug_context, const QString& title,
21 QWidget* parent = nullptr);
22
23 void OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data) override;
24 void OnPicaResume() override;
25
26private slots:
27 virtual void OnBreakPointHit(Pica::DebugContext::Event event, void* data) = 0;
28 virtual void OnResumed() = 0;
29
30signals:
31 void Resumed();
32 void BreakPointHit(Pica::DebugContext::Event event, void* data);
33};
diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp
index 43c59738f..1ba60021f 100644
--- a/src/citra_qt/debugger/graphics_framebuffer.cpp
+++ b/src/citra_qt/debugger/graphics_framebuffer.cpp
@@ -6,7 +6,6 @@
6#include <QComboBox> 6#include <QComboBox>
7#include <QDebug> 7#include <QDebug>
8#include <QLabel> 8#include <QLabel>
9#include <QMetaType>
10#include <QPushButton> 9#include <QPushButton>
11#include <QSpinBox> 10#include <QSpinBox>
12 11
@@ -17,32 +16,6 @@
17 16
18#include "util/spinbox.h" 17#include "util/spinbox.h"
19 18
20BreakPointObserverDock::BreakPointObserverDock(std::shared_ptr<Pica::DebugContext> debug_context,
21 const QString& title, QWidget* parent)
22 : QDockWidget(title, parent), BreakPointObserver(debug_context)
23{
24 qRegisterMetaType<Pica::DebugContext::Event>("Pica::DebugContext::Event");
25
26 connect(this, SIGNAL(Resumed()), this, SLOT(OnResumed()));
27
28 // NOTE: This signal is emitted from a non-GUI thread, but connect() takes
29 // care of delaying its handling to the GUI thread.
30 connect(this, SIGNAL(BreakPointHit(Pica::DebugContext::Event,void*)),
31 this, SLOT(OnBreakPointHit(Pica::DebugContext::Event,void*)),
32 Qt::BlockingQueuedConnection);
33}
34
35void BreakPointObserverDock::OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data)
36{
37 emit BreakPointHit(event, data);
38}
39
40void BreakPointObserverDock::OnPicaResume()
41{
42 emit Resumed();
43}
44
45
46GraphicsFramebufferWidget::GraphicsFramebufferWidget(std::shared_ptr<Pica::DebugContext> debug_context, 19GraphicsFramebufferWidget::GraphicsFramebufferWidget(std::shared_ptr<Pica::DebugContext> debug_context,
47 QWidget* parent) 20 QWidget* parent)
48 : BreakPointObserverDock(debug_context, tr("Pica Framebuffer"), parent), 21 : BreakPointObserverDock(debug_context, tr("Pica Framebuffer"), parent),
diff --git a/src/citra_qt/debugger/graphics_framebuffer.h b/src/citra_qt/debugger/graphics_framebuffer.h
index 56215761e..c6e293bc9 100644
--- a/src/citra_qt/debugger/graphics_framebuffer.h
+++ b/src/citra_qt/debugger/graphics_framebuffer.h
@@ -6,7 +6,7 @@
6 6
7#include <QDockWidget> 7#include <QDockWidget>
8 8
9#include "video_core/debug_utils/debug_utils.h" 9#include "graphics_breakpoint_observer.h"
10 10
11class QComboBox; 11class QComboBox;
12class QLabel; 12class QLabel;
@@ -14,28 +14,6 @@ class QSpinBox;
14 14
15class CSpinBox; 15class CSpinBox;
16 16
17// Utility class which forwards calls to OnPicaBreakPointHit and OnPicaResume to public slots.
18// This is because the Pica breakpoint callbacks are called from a non-GUI thread, while
19// the widget usually wants to perform reactions in the GUI thread.
20class BreakPointObserverDock : public QDockWidget, Pica::DebugContext::BreakPointObserver {
21 Q_OBJECT
22
23public:
24 BreakPointObserverDock(std::shared_ptr<Pica::DebugContext> debug_context, const QString& title,
25 QWidget* parent = nullptr);
26
27 void OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data) override;
28 void OnPicaResume() override;
29
30private slots:
31 virtual void OnBreakPointHit(Pica::DebugContext::Event event, void* data) = 0;
32 virtual void OnResumed() = 0;
33
34signals:
35 void Resumed();
36 void BreakPointHit(Pica::DebugContext::Event event, void* data);
37};
38
39class GraphicsFramebufferWidget : public BreakPointObserverDock { 17class GraphicsFramebufferWidget : public BreakPointObserverDock {
40 Q_OBJECT 18 Q_OBJECT
41 19