mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-04 05:04:33 +00:00
[PR #1192] [CLOSED] GDB server stub for remote debugging #380
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/stenzek/duckstation/pull/1192
Author: @boricj
Created: 12/10/2020
Status: ❌ Closed
Base:
master← Head:gdbserver📝 Commits (7)
2bfe6fdStringUtil: Add base support and hexadecimal functionse7effa4Settings: Add GDB server settingsfcf76e6Bus: Add peek/poke functionsfde0f4cCore: Add debug notifications to host interface9476bfdCore: Add CPU debug instrumentation9f783deCore: Implement GDB protocol3156f13Qt: Implement GDB debug server📊 Changes
23 files changed (+941 additions, -26 deletions)
View changed files
📝
src/common/string_util.cpp(+27 -0)📝
src/common/string_util.h(+11 -5)📝
src/core/CMakeLists.txt(+2 -0)📝
src/core/bus.cpp(+63 -0)📝
src/core/bus.h(+4 -0)📝
src/core/cpu_core.cpp(+114 -21)📝
src/core/cpu_core.h(+24 -0)📝
src/core/cpu_core_private.h(+56 -0)➕
src/core/gdb_protocol.cpp(+394 -0)➕
src/core/gdb_protocol.h(+10 -0)📝
src/core/host_interface.cpp(+4 -0)📝
src/core/host_interface.h(+4 -0)📝
src/core/settings.cpp(+2 -0)📝
src/core/settings.h(+3 -0)📝
src/duckstation-qt/CMakeLists.txt(+4 -0)➕
src/duckstation-qt/gdbconnection.cpp(+69 -0)➕
src/duckstation-qt/gdbconnection.h(+26 -0)➕
src/duckstation-qt/gdbserver.cpp(+45 -0)➕
src/duckstation-qt/gdbserver.h(+27 -0)📝
src/duckstation-qt/mainwindow.cpp(+28 -0)...and 3 more files
📄 Description
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 withtarget remote :1234.Settings to enable the GDB server:
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:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.