[PR #1192] GDB server stub for remote debugging #383

Closed
opened 2026-01-29 19:07:39 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/stenzek/duckstation/pull/1192

State: closed
Merged: No


I'm currently in the process of reverse-engineering a PS1 game and I need a good, modern PS1 emulator with a decent debugger. This is surprisingly hard to come by, so I've settled for a good, modern PS1 emulator and stick a GDB stub in it.

To use this, you need a GDB with MIPS support (I use gdb-multiarch with set architecture mips:3000). Enable the GDB server in the settings file, start the Qt frontend, boot something and connect to the server with target remote :1234.

Settings to enable the GDB server:

[Debug]
EnableGDBServer = true
GDBServerPort = 1234

This is extremely bare-bones at the moment, but it can peek/poke memory. My main concern so far is handling instruction-level breakpoints/watchpoints, since it appears the emulator can only be paused at frame intervals (which would be a couple million instructions too late).

TODO:

  • GDB server settings in configuration file
  • GDB server settings in Qt UI
  • GDB server for Qt frontend
  • GDB server for SDL frontend
  • Basic GDB server infrastructure
  • Read/write memory
  • Read/write general registers
  • Hackish frame-level interrupt/continue
  • Proper instruction-level interrupt/continue
  • Instruction step
  • Breakpoints
  • Watchpoints
**Original Pull Request:** https://github.com/stenzek/duckstation/pull/1192 **State:** closed **Merged:** No --- I'm currently in the process of reverse-engineering a PS1 game and I need a good, modern PS1 emulator with a decent debugger. This is surprisingly hard to come by, so I've settled for a good, modern PS1 emulator and stick a GDB stub in it. To use this, you need a GDB with MIPS support (I use gdb-multiarch with `set architecture mips:3000`). Enable the GDB server in the settings file, start the Qt frontend, boot something and connect to the server with `target remote :1234`. Settings to enable the GDB server: ``` [Debug] EnableGDBServer = true GDBServerPort = 1234 ``` This is extremely bare-bones at the moment, but it can peek/poke memory. My main concern so far is handling instruction-level breakpoints/watchpoints, since it appears the emulator can only be paused at frame intervals (which would be a couple million instructions too late). TODO: - [X] GDB server settings in configuration file - [ ] GDB server settings in Qt UI - [X] GDB server for Qt frontend - [ ] GDB server for SDL frontend - [X] Basic GDB server infrastructure - [X] Read/write memory - [X] Read/write general registers - [X] Hackish frame-level interrupt/continue - [x] Proper instruction-level interrupt/continue - [ ] Instruction step - [x] Breakpoints - [ ] Watchpoints
claunia added the pull-request label 2026-01-29 19:07:39 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/duckstation#383