Repository navigation
Let the VS Code launch bridge listen on a Unix socket - #45
Merged
Merged
Conversation
Without a debugPort in launch.json, vscode-rdbg runs `mrdbg --open` with no --host/--port and attaches over a Unix domain socket, as it does with rdbg. mrdbg now listens on a fresh socket (XDG_RUNTIME_DIR, else TMPDIR, else /tmp) in that case, or on the path a debugPort names (--sock-path), removes it on exit, and supports --util=gen-sockpath for useTerminal. A TCP debugPort works as before. DapServer now writes with MSG_NOSIGNAL: the terminated event sent after VS Code has already closed its end on disconnect raised SIGPIPE and killed the bridge before it could clean up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CpfQQRdc3R13RafigfCNVk
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.
Summary
launch.jsonno longer needs adebugPort. Without one, vscode-rdbg launchesmrdbg --openwith no--host/--portand attaches over a Unix domain socket, the same way it does withrdbg.mrdbgnow supports that:debugPortin launch.json$XDG_RUNTIME_DIR/mrdbg-<pid>, else$TMPDIR, else/tmp--sock-path=PATHhost:port--host=… --port=…Options: on--open,--sock-pathis the DAP side (dap_sock_path), like--host/--port. Adds--util.CLI.launch_dap: picks TCP or a Unix socket, printsDEBUGGER: Debugger can attach via UNIX domain socket (PATH), and removes the socket file on exit.--util=gen-sockpath: vscode-rdbg runs this first withuseTerminal: true.DapServernow takes an already-bound server (TCPServerorUNIXServer) from its caller.debugPortis optional now.SIGPIPE fix
VS Code closes its end right after
disconnect. Theterminatedevent sent when the device then hits EOF raised SIGPIPE and killed the bridge before it could clean up. Over TCP this went unnoticed; with a Unix socket it left a stale socket file behind.DapServernow writes throughTransport::Socket(MSG_NOSIGNAL) and ends the session once the client is gone.Not covered
attachwithout adebugPort(vscode-rdbg's--util=list-sockslookup). The manualmrdbg --dap-portbridge is still TCP only.--port=0, vscode-rdbg's default on Windows) is still rejected.Testing
rake test:unit: 0 KO. New tests cover option parsing,gen_sock_path,--util, and failure reporting.rake test:smoke: 0 failures.mruby app.rblistening on TCP. It ran four cases: nodebugPort,XDG_RUNTIME_DIRset,debugPortas a path, and TCP. Each went through initialize → entry stop →next→evaluate→disconnect,mrdbgexited 0, and no socket file was left behind.launch.jsonthat has nodebugPort.🤖 Generated with Claude Code
https://claude.ai/code/session_01CpfQQRdc3R13RafigfCNVk