diff options
| author | 2022-06-01 00:19:49 -0400 | |
|---|---|---|
| committer | 2022-06-01 00:19:49 -0400 | |
| commit | de2f2e5140eb85311e0fd844c580d6726adf7e03 (patch) | |
| tree | 10f0e96a0689b2edb823f5833ff388ac9c645229 /src/core/debugger/debugger.h | |
| parent | Merge pull request #8401 from zhaobot/tx-update-20220601034505 (diff) | |
| parent | core/debugger: Implement new GDB stub debugger (diff) | |
| download | yuzu-de2f2e5140eb85311e0fd844c580d6726adf7e03.tar.gz yuzu-de2f2e5140eb85311e0fd844c580d6726adf7e03.tar.xz yuzu-de2f2e5140eb85311e0fd844c580d6726adf7e03.zip | |
Merge pull request #8394 from liamwhite/debugger
core/debugger: Implement new GDB stub debugger
Diffstat (limited to 'src/core/debugger/debugger.h')
| -rw-r--r-- | src/core/debugger/debugger.h | 46 |
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 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <memory> | ||
| 7 | |||
| 8 | #include "common/common_types.h" | ||
| 9 | |||
| 10 | namespace Kernel { | ||
| 11 | class KThread; | ||
| 12 | } | ||
| 13 | |||
| 14 | namespace Core { | ||
| 15 | class System; | ||
| 16 | |||
| 17 | class DebuggerImpl; | ||
| 18 | |||
| 19 | class Debugger { | ||
| 20 | public: | ||
| 21 | /** | ||
| 22 | * Blocks and waits for a connection on localhost, port `server_port`. | ||
| 23 | * Does not create the debugger if the port is already in use. | ||
| 24 | */ | ||
| 25 | explicit Debugger(Core::System& system, u16 server_port); | ||
| 26 | ~Debugger(); | ||
| 27 | |||
| 28 | /** | ||
| 29 | * Notify the debugger that the given thread is stopped | ||
| 30 | * (due to a breakpoint, or due to stopping after a successful step). | ||
| 31 | * | ||
| 32 | * The debugger will asynchronously halt emulation after the notification has | ||
| 33 | * occurred. If another thread attempts to notify before emulation has stopped, | ||
| 34 | * it is ignored and this method will return false. Otherwise it will return true. | ||
| 35 | */ | ||
| 36 | bool NotifyThreadStopped(Kernel::KThread* thread); | ||
| 37 | |||
| 38 | /** | ||
| 39 | * Returns whether a step is in progress. | ||
| 40 | */ | ||
| 41 | bool IsStepping() const; | ||
| 42 | |||
| 43 | private: | ||
| 44 | std::unique_ptr<DebuggerImpl> impl; | ||
| 45 | }; | ||
| 46 | } // namespace Core | ||