[PR #2952] [MERGED] GDBServer: Fix emulator deadlock on client connection #1381

Open
opened 2026-01-29 19:16:36 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/stenzek/duckstation/pull/2952
Author: @boricj
Created: 2/25/2023
Status: Merged
Merged: 3/13/2023
Merged by: @stenzek

Base: masterHead: bugfix/GDBServer


📝 Commits (2)

  • 7810e68 Qt: Run GDB server on emulation thread
  • d65fb0e Qt: Add toggle to enable GDB server

📊 Changes

9 files changed (+91 additions, -65 deletions)

View changed files

📝 src/duckstation-qt/gdbconnection.cpp (+30 -25)
📝 src/duckstation-qt/gdbconnection.h (+5 -4)
📝 src/duckstation-qt/gdbserver.cpp (+30 -17)
📝 src/duckstation-qt/gdbserver.h (+5 -4)
📝 src/duckstation-qt/mainwindow.cpp (+7 -11)
📝 src/duckstation-qt/mainwindow.h (+0 -4)
📝 src/duckstation-qt/mainwindow.ui (+9 -0)
📝 src/duckstation-qt/qthost.cpp (+3 -0)
📝 src/duckstation-qt/qthost.h (+2 -0)

📄 Description

The GDB server has a regression bisected down to 8d7aea5e19: DuckStation hangs when a client connects and the GDB connection tries to pause a running emulation, or at least it hangs every single time on my system.

I'm no Qt expert and I don't know what's going on (I also have hangs when I try to open the CPU Debugger window if the emulator isn't paused, so something's definitely fishy), but migrating the GDB stuff to the CPU emulation thread no longer causes DuckStation to hang while playing around with the GDB connection. We can't mess around with the emulated CPU if it's running anyway, so I don't expect this to be a problem.

While I'm here, let's also add an option toggle for enabling the GDB server in the Debug menu for visibility. It only modifies the setting and does not start/stop the GDB server on-the-fly, so it takes effect on the next power-on of the console.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/stenzek/duckstation/pull/2952 **Author:** [@boricj](https://github.com/boricj) **Created:** 2/25/2023 **Status:** ✅ Merged **Merged:** 3/13/2023 **Merged by:** [@stenzek](https://github.com/stenzek) **Base:** `master` ← **Head:** `bugfix/GDBServer` --- ### 📝 Commits (2) - [`7810e68`](https://github.com/stenzek/duckstation/commit/7810e68a5839d12b9b9a50e669e6a940fccdd449) Qt: Run GDB server on emulation thread - [`d65fb0e`](https://github.com/stenzek/duckstation/commit/d65fb0e86a40b3eb4f8a4127379d420fbca14d33) Qt: Add toggle to enable GDB server ### 📊 Changes **9 files changed** (+91 additions, -65 deletions) <details> <summary>View changed files</summary> 📝 `src/duckstation-qt/gdbconnection.cpp` (+30 -25) 📝 `src/duckstation-qt/gdbconnection.h` (+5 -4) 📝 `src/duckstation-qt/gdbserver.cpp` (+30 -17) 📝 `src/duckstation-qt/gdbserver.h` (+5 -4) 📝 `src/duckstation-qt/mainwindow.cpp` (+7 -11) 📝 `src/duckstation-qt/mainwindow.h` (+0 -4) 📝 `src/duckstation-qt/mainwindow.ui` (+9 -0) 📝 `src/duckstation-qt/qthost.cpp` (+3 -0) 📝 `src/duckstation-qt/qthost.h` (+2 -0) </details> ### 📄 Description The GDB server has a regression bisected down to 8d7aea5e19859ed483699cc4a5dbd47165c7be8b: DuckStation hangs when a client connects and the GDB connection tries to pause a running emulation, or at least it hangs every single time on my system. I'm no Qt expert and I don't know what's going on (I also have hangs when I try to open the CPU Debugger window if the emulator isn't paused, so something's definitely fishy), but migrating the GDB stuff to the CPU emulation thread no longer causes DuckStation to hang while playing around with the GDB connection. We can't mess around with the emulated CPU if it's running anyway, so I don't expect this to be a problem. While I'm here, let's also add an option toggle for enabling the GDB server in the Debug menu for visibility. It only modifies the setting and does not start/stop the GDB server on-the-fly, so it takes effect on the next power-on of the console. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 19:16:36 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/duckstation#1381