AGENTS.md: point future sessions at the WebSocket debugger workflow

Expand the WebSocket debugger section with pointers so an agent can get
back into this work without re-deriving it: read docs/WebSocketDebugger.md
before touching the interface (it's the source of truth, not memory), and
a recipe for spinning up a live PPSSPP + Tools/wsdbg session for manual
testing. PSP homebrew isn't checked into this repo, so this asks the user
for one (or to install one via the Homebrew Store) rather than assuming a
specific local file exists.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XDNwPPuidmNxQGRJxBuRL6
This commit is contained in:
Henrik RydgårdandClaude Opus 5 committed 2026-07-26 21:17:28 +02:00
1 parent 074c8ac523
commit cf873b8c6b
1 file changed
+23 -9
+23 -9
View File
@@ -71,15 +71,29 @@ small examples to copy from). A module is a `const HLEFunction <name>[]` table o
## WebSocket debugger
PPSSPP has a JSON/WebSocket debugger and automation API (connect, read/write memory, set breakpoints, step the CPU,
read GPU state, inject input, tail logs, etc.), served on the same port as Remote ISO sharing at `/debugger` with
subprotocol `debugger.ppsspp.org`. Implementation is in `Core/Debugger/WebSocket.cpp` and
`Core/Debugger/WebSocket/*Subscriber.cpp` (one file per feature area, each documented at the top). Enable it via
Settings > Tools > Developer Tools > "Allow remote debugger", `RemoteDebuggerOnStartup` in the config, or (application
build only, not headless) the `--debugger` command line flag. The bundled web GUI at `/debugger/` comes from the
`assets/debugger` submodule (`unknownbrackets/ppsspp-debugger`, `bundled` branch). For the full protocol reference and
event catalog, see `docs/WebSocketDebugger.md`. A standalone CLI client for talking to it directly lives in
`Tools/wsdbg/`.
PPSSPP has a JSON/WebSocket debugger and automation API (connect, read/write memory, search memory for values or byte
patterns, set breakpoints, step the CPU, label data symbols, read GPU state, inject input, tail logs, etc.), served on
the same port as Remote ISO sharing at `/debugger` with subprotocol `debugger.ppsspp.org`. Implementation is in
`Core/Debugger/WebSocket.cpp` and `Core/Debugger/WebSocket/*Subscriber.cpp` (one file per feature area, each
documented at the top). Enable it via Settings > Tools > Developer Tools > "Allow remote debugger",
`RemoteDebuggerOnStartup` in the config, or (application build only, not headless) the `--debugger` command line
flag. The bundled web GUI at `/debugger/` comes from the `assets/debugger` submodule
(`unknownbrackets/ppsspp-debugger`, `bundled` branch).
**Before touching this interface, read `docs/WebSocketDebugger.md`** - it has the full protocol reference and event
catalog (including which events are read-only vs. require `cpu.stepping` first). Don't guess event names or
parameters from memory; the doc (and each `*Subscriber.cpp` file's per-handler comments) is the source of truth, and
new events get added over time (e.g. `memory.search`, `hle.data.*`).
To quickly get a live session going for manual testing (e.g. after adding/changing an event): build `PPSSPPWindows`
(see Build and Validation above), then run it with `--debugger` and something that keeps running/looping so the CPU
stays alive, so requests get a response instead of "CPU not started"/"CPU not active" errors. Any homebrew or game
works; PSP homebrew isn't checked into this repo, so if you don't already have something installed under
`memstick/PSP/GAME/`, ask the user for a `.iso`/`.cso`/`.elf`/`EBOOT.PBP` to boot, or to install one via the in-app
Homebrew Store. Watch the log output (`--log=somefile.log`) for the line `Listening on port N`, then point
`Tools/wsdbg/` at that port (`cargo run -- N <event> [key=value...]` for one-shot, or `cargo run -- N` for a REPL).
Most mutating events (`hle.func.*`, `hle.data.*`, memory writes while paused, etc.) require the CPU to be stopped
first - send `cpu.stepping` and `cpu.resume` to pause/unpause.
## Quick rebuild on Linux