summaryrefslogtreecommitdiffstats
path: root/src/core/debugger/debugger.h
diff options
context:
space:
mode:
authorMai M <mathew1800@gmail.com>2022-06-01 06:19:49 +0200
committerGitHub <noreply@github.com>2022-06-01 06:19:49 +0200
commitde2f2e5140eb85311e0fd844c580d6726adf7e03 (patch)
tree10f0e96a0689b2edb823f5833ff388ac9c645229 /src/core/debugger/debugger.h
parentMerge pull request #8401 from zhaobot/tx-update-20220601034505 (diff)
parentcore/debugger: Implement new GDB stub debugger (diff)
downloadyuzu-de2f2e5140eb85311e0fd844c580d6726adf7e03.tar
yuzu-de2f2e5140eb85311e0fd844c580d6726adf7e03.tar.gz
yuzu-de2f2e5140eb85311e0fd844c580d6726adf7e03.tar.bz2
yuzu-de2f2e5140eb85311e0fd844c580d6726adf7e03.tar.lz
yuzu-de2f2e5140eb85311e0fd844c580d6726adf7e03.tar.xz
yuzu-de2f2e5140eb85311e0fd844c580d6726adf7e03.tar.zst
yuzu-de2f2e5140eb85311e0fd844c580d6726adf7e03.zip
Diffstat (limited to '')
-rw-r--r--src/core/debugger/debugger.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/core/debugger/debugger.h b/src/core/debugger/debugger.h
new file mode 100644
index 000000000..7acd11815
--- /dev/null
+++ b/src/core/debugger/debugger.h
@@ -0,0 +1,46 @@
+// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <memory>
+
+#include "common/common_types.h"
+
+namespace Kernel {
+class KThread;
+}
+
+namespace Core {
+class System;
+
+class DebuggerImpl;
+
+class Debugger {
+public:
+ /**
+ * Blocks and waits for a connection on localhost, port `server_port`.
+ * Does not create the debugger if the port is already in use.
+ */
+ explicit Debugger(Core::System& system, u16 server_port);
+ ~Debugger();
+
+ /**
+ * Notify the debugger that the given thread is stopped
+ * (due to a breakpoint, or due to stopping after a successful step).
+ *
+ * The debugger will asynchronously halt emulation after the notification has
+ * occurred. If another thread attempts to notify before emulation has stopped,
+ * it is ignored and this method will return false. Otherwise it will return true.
+ */
+ bool NotifyThreadStopped(Kernel::KThread* thread);
+
+ /**
+ * Returns whether a step is in progress.
+ */
+ bool IsStepping() const;
+
+private:
+ std::unique_ptr<DebuggerImpl> impl;
+};
+} // namespace Core