From fb4b3c127f7c390358d7f4cadd2f58de116fec48 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 30 May 2022 19:35:01 -0400 Subject: core/debugger: Implement new GDB stub debugger --- src/core/debugger/debugger.h | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/core/debugger/debugger.h (limited to 'src/core/debugger/debugger.h') 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 + +#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 impl; +}; +} // namespace Core -- cgit v1.2.3