summaryrefslogtreecommitdiffstats
path: root/src/core/debugger/debugger.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-06-06 18:56:01 +0200
committerLiam <byteslice@airmail.cc>2022-06-16 19:18:07 +0200
commit208ed712f42cfd277405a22663197dc1c5e84cfe (patch)
tree56c1a3cbddf392d700e817cd4093564e3f096013 /src/core/debugger/debugger.cpp
parentMerge pull request #8457 from liamwhite/kprocess-suspend (diff)
downloadyuzu-208ed712f42cfd277405a22663197dc1c5e84cfe.tar
yuzu-208ed712f42cfd277405a22663197dc1c5e84cfe.tar.gz
yuzu-208ed712f42cfd277405a22663197dc1c5e84cfe.tar.bz2
yuzu-208ed712f42cfd277405a22663197dc1c5e84cfe.tar.lz
yuzu-208ed712f42cfd277405a22663197dc1c5e84cfe.tar.xz
yuzu-208ed712f42cfd277405a22663197dc1c5e84cfe.tar.zst
yuzu-208ed712f42cfd277405a22663197dc1c5e84cfe.zip
Diffstat (limited to 'src/core/debugger/debugger.cpp')
-rw-r--r--src/core/debugger/debugger.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/core/debugger/debugger.cpp b/src/core/debugger/debugger.cpp
index ab3940922..ac64d2f9d 100644
--- a/src/core/debugger/debugger.cpp
+++ b/src/core/debugger/debugger.cpp
@@ -44,12 +44,14 @@ static std::span<const u8> ReceiveInto(Readable& r, Buffer& buffer) {
enum class SignalType {
Stopped,
+ Watchpoint,
ShuttingDown,
};
struct SignalInfo {
SignalType type;
Kernel::KThread* thread;
+ const Kernel::DebugWatchpoint* watchpoint;
};
namespace Core {
@@ -157,13 +159,19 @@ private:
void PipeData(std::span<const u8> data) {
switch (info.type) {
case SignalType::Stopped:
+ case SignalType::Watchpoint:
// Stop emulation.
PauseEmulation();
// Notify the client.
active_thread = info.thread;
UpdateActiveThread();
- frontend->Stopped(active_thread);
+
+ if (info.type == SignalType::Watchpoint) {
+ frontend->Watchpoint(active_thread, *info.watchpoint);
+ } else {
+ frontend->Stopped(active_thread);
+ }
break;
case SignalType::ShuttingDown:
@@ -290,12 +298,17 @@ Debugger::Debugger(Core::System& system, u16 port) {
Debugger::~Debugger() = default;
bool Debugger::NotifyThreadStopped(Kernel::KThread* thread) {
- return impl && impl->SignalDebugger(SignalInfo{SignalType::Stopped, thread});
+ return impl && impl->SignalDebugger(SignalInfo{SignalType::Stopped, thread, nullptr});
+}
+
+bool Debugger::NotifyThreadWatchpoint(Kernel::KThread* thread,
+ const Kernel::DebugWatchpoint& watch) {
+ return impl && impl->SignalDebugger(SignalInfo{SignalType::Watchpoint, thread, &watch});
}
void Debugger::NotifyShutdown() {
if (impl) {
- impl->SignalDebugger(SignalInfo{SignalType::ShuttingDown, nullptr});
+ impl->SignalDebugger(SignalInfo{SignalType::ShuttingDown, nullptr, nullptr});
}
}