grumpycoders / grumpycoders/pcsx-redux

Breakpoints silently no-op without -debugger (Lua API and GDB stub)

Open
#2,071 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
994
Forks
151
Avg merge
1d 15h
Merged PRs (30d)
18

Description

Running headless with `-dofile`, breakpoints set via `PCSX.addBreakpoint` never fire. `addBreakpoint` returns a valid object and raises no error, but the callback is never invoked — verified both on the game's per-frame loop and on the BIOS reset vector at `0xBFC00000`, which unquestionably executes. `PCSX.nextTick` also never fires in this mode.

The same applies to the GDB stub. `Z0`–`Z4` all reply `OK`, but no breakpoint or watchpoint ever triggers. Notably `qSupported` advertises `PacketSize`, `qXfer:*` and `QStartNoAckMode` — but neither `swbreak+` nor `hwbreak+`.

Adding `-debugger` fixes both immediately: Lua callbacks fire, and GDB watchpoints trigger correctly.

This is reasonable behaviour, but it's undiscoverable. The CLI docs describe `-debugger` as "Activates the debugger" without indicating that breakpoints are inert without it, and a stub answering `OK` to `Z` packets it then ignores is hard to distinguish from a target where the breakpoint simply hasn't been hit yet.

Suggestions, in rough order of value:

- Mention the `-debugger` dependency in the Lua and CLI docs
- Have the GDB stub return an empty reply (the RSP convention for "unsupported") for `Z` packets when the debugger is inactive
- Optionally log a warning when `addBreakpoint` is called with the debugger off

One caveat for completeness: I did not test whether Lua breakpoints work *with* `-debugger` in headless mode specifically — I confirmed GDB watchpoints do and moved on. The `qSupported` observation and the docs gap stand regardless.

Version: nightly build 360 (24892.20260724.3, x64), Windows, interpreter core.

Contributor guide

Open the contributing guide

Research direction

Reproduce the headless `-dofile` case, then trace the Lua breakpoint/`nextTick` entry points and the GDB stub's `Z0`–`Z4` handling, comparing both with `-debugger` enabled. Done means the Lua and CLI documentation states the dependency and the stub's inactive-debugger behavior is made explicit and covered by the relevant checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, lua
Domain
cli, documentation, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.