summaryrefslogtreecommitdiffstats
path: root/src/core/gdbstub/gdbstub.cpp
diff options
context:
space:
mode:
authorGauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>2020-02-23 21:33:49 +0100
committerFearlessTobi <thm.frey@gmail.com>2020-03-17 11:18:13 +0100
commit38036eb1c8633d151c721992e085e1aca5658f9d (patch)
treed9866995796f24394134f4568f567343c89af288 /src/core/gdbstub/gdbstub.cpp
parentMerge pull request #3521 from ReinUsesLisp/nsight-debug (diff)
downloadyuzu-38036eb1c8633d151c721992e085e1aca5658f9d.tar
yuzu-38036eb1c8633d151c721992e085e1aca5658f9d.tar.gz
yuzu-38036eb1c8633d151c721992e085e1aca5658f9d.tar.bz2
yuzu-38036eb1c8633d151c721992e085e1aca5658f9d.tar.lz
yuzu-38036eb1c8633d151c721992e085e1aca5658f9d.tar.xz
yuzu-38036eb1c8633d151c721992e085e1aca5658f9d.tar.zst
yuzu-38036eb1c8633d151c721992e085e1aca5658f9d.zip
Diffstat (limited to 'src/core/gdbstub/gdbstub.cpp')
-rw-r--r--src/core/gdbstub/gdbstub.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp
index e8d8871a7..6ee4df6b5 100644
--- a/src/core/gdbstub/gdbstub.cpp
+++ b/src/core/gdbstub/gdbstub.cpp
@@ -141,6 +141,7 @@ constexpr char target_xml[] =
)";
int gdbserver_socket = -1;
+bool defer_start = false;
u8 command_buffer[GDB_BUFFER_SIZE];
u32 command_length;
@@ -1165,7 +1166,8 @@ static void RemoveBreakpoint() {
}
void HandlePacket() {
- if (!IsConnected()) {
+ if (!IsConnected() && defer_start) {
+ ToggleServer(true);
return;
}
@@ -1256,6 +1258,10 @@ void ToggleServer(bool status) {
}
}
+void DeferStart() {
+ defer_start = true;
+}
+
static void Init(u16 port) {
if (!server_enabled) {
// Set the halt loop to false in case the user enabled the gdbstub mid-execution.
@@ -1341,6 +1347,7 @@ void Shutdown() {
if (!server_enabled) {
return;
}
+ defer_start = false;
LOG_INFO(Debug_GDBStub, "Stopping GDB ...");
if (gdbserver_socket != -1) {