summaryrefslogtreecommitdiff
path: root/src/core/gdbstub/gdbstub.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2020-03-24 16:50:58 -0400
committerGravatar GitHub2020-03-24 16:50:58 -0400
commitf8382c9d9df5cbbfc37f0e4e3952b162d3cdd1ae (patch)
tree278f7cdcbd0ceca35c041e833f0dcbd5b7e3e895 /src/core/gdbstub/gdbstub.cpp
parentMerge pull request #3543 from ReinUsesLisp/gl-depth-range (diff)
parentgdbstub: small logic bug fix with defer_start (diff)
downloadyuzu-f8382c9d9df5cbbfc37f0e4e3952b162d3cdd1ae.tar.gz
yuzu-f8382c9d9df5cbbfc37f0e4e3952b162d3cdd1ae.tar.xz
yuzu-f8382c9d9df5cbbfc37f0e4e3952b162d3cdd1ae.zip
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.cpp9
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[] =
141)"; 141)";
142 142
143int gdbserver_socket = -1; 143int gdbserver_socket = -1;
144bool defer_start = false;
144 145
145u8 command_buffer[GDB_BUFFER_SIZE]; 146u8 command_buffer[GDB_BUFFER_SIZE];
146u32 command_length; 147u32 command_length;
@@ -1166,6 +1167,9 @@ static void RemoveBreakpoint() {
1166 1167
1167void HandlePacket() { 1168void HandlePacket() {
1168 if (!IsConnected()) { 1169 if (!IsConnected()) {
1170 if (defer_start) {
1171 ToggleServer(true);
1172 }
1169 return; 1173 return;
1170 } 1174 }
1171 1175
@@ -1256,6 +1260,10 @@ void ToggleServer(bool status) {
1256 } 1260 }
1257} 1261}
1258 1262
1263void DeferStart() {
1264 defer_start = true;
1265}
1266
1259static void Init(u16 port) { 1267static void Init(u16 port) {
1260 if (!server_enabled) { 1268 if (!server_enabled) {
1261 // Set the halt loop to false in case the user enabled the gdbstub mid-execution. 1269 // Set the halt loop to false in case the user enabled the gdbstub mid-execution.
@@ -1341,6 +1349,7 @@ void Shutdown() {
1341 if (!server_enabled) { 1349 if (!server_enabled) {
1342 return; 1350 return;
1343 } 1351 }
1352 defer_start = false;
1344 1353
1345 LOG_INFO(Debug_GDBStub, "Stopping GDB ..."); 1354 LOG_INFO(Debug_GDBStub, "Stopping GDB ...");
1346 if (gdbserver_socket != -1) { 1355 if (gdbserver_socket != -1) {