diff options
author | bunnei <bunneidev@gmail.com> | 2020-03-24 16:50:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-24 16:50:58 -0400 |
commit | f8382c9d9df5cbbfc37f0e4e3952b162d3cdd1ae (patch) | |
tree | 278f7cdcbd0ceca35c041e833f0dcbd5b7e3e895 /src/core/gdbstub/gdbstub.cpp | |
parent | 497f59352588a2926987be2131aa0ff9ce959dd7 (diff) | |
parent | eae2ed6b07054a7cb9eca1bc930f4bb9f973a329 (diff) |
Merge pull request #3524 from FearlessTobi/port-5106
Port citra-emu/citra#5106: "gdbstub: Ensure gdbstub doesn't drop packets crucial to initialization"
Diffstat (limited to 'src/core/gdbstub/gdbstub.cpp')
-rw-r--r-- | src/core/gdbstub/gdbstub.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index e8d8871a7..6d15aeed9 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; @@ -1166,6 +1167,9 @@ static void RemoveBreakpoint() { void HandlePacket() { if (!IsConnected()) { + if (defer_start) { + ToggleServer(true); + } return; } @@ -1256,6 +1260,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 +1349,7 @@ void Shutdown() { if (!server_enabled) { return; } + defer_start = false; LOG_INFO(Debug_GDBStub, "Stopping GDB ..."); if (gdbserver_socket != -1) { |