Skip to content

fix(xdebug): drop a leading backslash from an exception breakpoint class - #403

Merged
butschster merged 1 commit into
masterfrom
fix/xdebug-exception-bp-backslash
Nov 7, 2026
Merged

butschster merged 1 commit into
masterfrom
fix/xdebug-exception-bp-backslash

Conversation

@butschster

Copy link
Copy Markdown
Member

What

Xdebug matches an exception breakpoint by the class name as PHP holds it, with no leading \. breakpoint_set -t exception -x "\RuntimeException" is accepted (shown resolved) and never fires — from the UI, REST and MCP xdebug_breakpoint_set alike.

SavedBreakpoint.normalize() now strips one leading \ from exception; * stays allowed; a lone \ is rejected as empty. Doc comment, error text and the MCP schema hint now show Throwable / App\Exceptions\PaymentFailed.

Tests

  • New TestBreakpoints_ExceptionLeadingBackslash (table: \RuntimeException, \App\Errors\Payment, RuntimeException, *, lone \) checks the stored class and the breakpoint_set command; fails without the fix.
  • Existing expectations in TestBreakpoints_SentAtStartWithState and the REST test updated to the stripped name.
  • go vet ./modules/xdebug/ clean; go test -race -count=1 ./modules/xdebug/ ok.
  • Live, PHP 8.3.36 + Xdebug 3.4.5, raw DBGp client: -x \RuntimeException → run ends stopping; -x RuntimeException → status="break" with exception="RuntimeException".

Made with harnsy

Xdebug matches an exception breakpoint by the class name as PHP holds it,
with no leading backslash: "\RuntimeException" was accepted, shown resolved
and never fired. normalize() now strips one leading backslash, so the UI,
REST and MCP send "RuntimeException"; "*" stays allowed.
@butschster butschster added the type: bug Something is broken or behaves incorrectly label Nov 7, 2026
@butschster
butschster merged commit c1eecf9 into master Nov 7, 2026
1 check passed
@butschster
butschster deleted the fix/xdebug-exception-bp-backslash branch November 7, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something is broken or behaves incorrectly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant