diff options
| author | 2016-12-15 16:19:30 -0500 | |
|---|---|---|
| committer | 2016-12-15 16:37:22 -0500 | |
| commit | ba20dd9b6125551ecf2016ed7dbd61dc618fc876 (patch) | |
| tree | 339289e4a87660df3edf1d3263ecb0e22ca2b573 /src/core/gdbstub/gdbstub.h | |
| parent | Merge pull request #2330 from lioncash/pragma (diff) | |
| download | yuzu-ba20dd9b6125551ecf2016ed7dbd61dc618fc876.tar.gz yuzu-ba20dd9b6125551ecf2016ed7dbd61dc618fc876.tar.xz yuzu-ba20dd9b6125551ecf2016ed7dbd61dc618fc876.zip | |
gdbstub: Remove global variable from public interface
Currently, this is only ever queried, so adding a function to check if the
server is enabled is more sensible.
If directly modifying this externally is ever desirable, it should be done
by adding a function to the interface, rather than exposing implementation
details directly.
Diffstat (limited to 'src/core/gdbstub/gdbstub.h')
| -rw-r--r-- | src/core/gdbstub/gdbstub.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/gdbstub/gdbstub.h b/src/core/gdbstub/gdbstub.h index a7483bb10..38177e32c 100644 --- a/src/core/gdbstub/gdbstub.h +++ b/src/core/gdbstub/gdbstub.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | // Originally written by Sven Peter <sven@fail0verflow.com> for anergistic. | 5 | // Originally written by Sven Peter <sven@fail0verflow.com> for anergistic. |
| 6 | 6 | ||
| 7 | #pragma once | 7 | #pragma once |
| 8 | #include <atomic> | 8 | |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace GDBStub { | 11 | namespace GDBStub { |
| @@ -24,10 +24,6 @@ struct BreakpointAddress { | |||
| 24 | BreakpointType type; | 24 | BreakpointType type; |
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | /// If set to false, the server will never be started and no gdbstub-related functions will be | ||
| 28 | /// executed. | ||
| 29 | extern std::atomic<bool> g_server_enabled; | ||
| 30 | |||
| 31 | /** | 27 | /** |
| 32 | * Set the port the gdbstub should use to listen for connections. | 28 | * Set the port the gdbstub should use to listen for connections. |
| 33 | * | 29 | * |
| @@ -36,7 +32,7 @@ extern std::atomic<bool> g_server_enabled; | |||
| 36 | void SetServerPort(u16 port); | 32 | void SetServerPort(u16 port); |
| 37 | 33 | ||
| 38 | /** | 34 | /** |
| 39 | * Set the g_server_enabled flag and start or stop the server if possible. | 35 | * Starts or stops the server if possible. |
| 40 | * | 36 | * |
| 41 | * @param status Set the server to enabled or disabled. | 37 | * @param status Set the server to enabled or disabled. |
| 42 | */ | 38 | */ |
| @@ -48,6 +44,9 @@ void Init(); | |||
| 48 | /// Stop gdbstub server. | 44 | /// Stop gdbstub server. |
| 49 | void Shutdown(); | 45 | void Shutdown(); |
| 50 | 46 | ||
| 47 | /// Checks if the gdbstub server is enabled. | ||
| 48 | bool IsServerEnabled(); | ||
| 49 | |||
| 51 | /// Returns true if there is an active socket connection. | 50 | /// Returns true if there is an active socket connection. |
| 52 | bool IsConnected(); | 51 | bool IsConnected(); |
| 53 | 52 | ||