diff --git a/AGENTS.md b/AGENTS.md index c5ea0eca88..f45b74aacb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -71,15 +71,29 @@ small examples to copy from). A module is a `const HLEFunction []` 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 [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