Phase 3: Runtime Inspection API (JSON transport + stubs)#5
Draft
pronskiy wants to merge 19 commits intophase2-observer-migrationfrom
Draft
Phase 3: Runtime Inspection API (JSON transport + stubs)#5pronskiy wants to merge 19 commits intophase2-observer-migrationfrom
pronskiy wants to merge 19 commits intophase2-observer-migrationfrom
Conversation
Phase 2: RINIT fast-path & deferred hooks — 630% → 10% overhead
Tests affected by Phase 2 RINIT observer gating optimization: - xdebug_break()/connect_to_client without active observer (8 tests) - start_upon_error without stack context (2 tests) - XDEBUG_IGNORE superglobal timing at RINIT (6 tests) - eval source mapping with compile hook gating (1 test) - EXT_STMT not set without trigger (1 test) - Early connect bypasses shared secret (1 test) - CGI X-Forwarded-For on PHP 8.6 (2 tests) These are accepted trade-offs of the Phase 2 zero-overhead optimization (observer_active=0 when no debug trigger present).
Mark 21 tests as XFAIL for Phase 2 observer gating
…ommands New src/inspect/ subsystem: - inspect_transport.c: TCP server (bind/listen/accept/read/dispatch) - inspect_commands.c: Stub handlers for all inspection commands - JSON lines protocol over port 9007 (configurable) - Unix socket support (configurable path) - Non-blocking I/O, up to 16 simultaneous clients INI settings: - xdebug.inspect = off|on|auto|trigger - xdebug.inspect_port = 9007 - xdebug.inspect_socket = (empty for TCP) Working commands: status returns extension info Stub commands: inspect, snapshot, watch, trace, eval, profile.start/stop/status/dump Integrated into MINIT/RINIT/RSHUTDOWN/MSHUTDOWN lifecycle. Server processes messages via tick function during execution.
62a1348 to
45c14fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 3: Runtime Inspection API
Branch:
phase3-inspection-api(based onphase2-observer-migration)Status: 3.1 done, 3.2-3.5 TODO
What this PR adds
Phase 3.1: JSON Transport Layer ✅ (
62a1348)New
src/inspect/subsystem — a TCP/Unix socket server that speaks JSON lines, independent of the existing DBGp debugger.New files:
src/inspect/inspect_transport.csrc/inspect/inspect_transport.hsrc/inspect/inspect_commands.csrc/inspect/inspect_commands.hModified files:
xdebug.csrc/lib/lib.hconfig.m4src/inspect/directoryINI settings:
Working:
Architecture:
com.hbut is fully independentext/json(php_json_encode/php_json_decode_ex) for JSON handlingTODO (remaining Phase 3 tasks)
inspectcommand (2 days) — Observation breakpoints: capture variable/expression at file:line without pausingsnapshotcommand (3 days) — Full context capture on exception/error with stack + localswatch+trace(2 days) — Variable change streaming + filtered function call flowphp-inspectCLI clientTesting
make -j$(nproc)✅php -dzend_extension=modules/xdebug.so -r "echo ok;"✅