Skip to content

Cherrypick lldb-mcp improvements - #13565

Merged
JDevlieghere merged 4 commits into
swiftlang:stable/21.xfrom
JDevlieghere:jdevlieghere/mcp-fixes-21.x
Aug 2, 2026
Merged

Cherrypick lldb-mcp improvements#13565
JDevlieghere merged 4 commits into
swiftlang:stable/21.xfrom
JDevlieghere:jdevlieghere/mcp-fixes-21.x

Conversation

@JDevlieghere

Copy link
Copy Markdown
PR Title
#212681 [lldb-mcp] Run managed debug sessions synchronously
#212680 [lldb-mcp] Add --help and --version
#212678 [lldb] Reply to malformed requests and use JSON-RPC error codes

lldb-mcp accepted no arguments at all, so --help and --version fell
through to the protocol loop and blocked reading stdin, and a mistyped
flag was silently ignored while the tool waited for MCP traffic. Handle
both flags and reject anything else with a usage message.

(cherry picked from commit f958a55)
…#212678)

The transport dropped a message that failed to parse: it logged the
error and returned, so a peer waiting on that request hung forever and
every message already buffered behind it was discarded. Keep going after
a failed parse, and add ReplyWithParseError so a message that is valid
JSON but not a valid request is answered against its own id. Unparseable
JSON still gets no reply, since it carries no id and JSON-RPC forbids
inventing one.

Method-not-found was raised with createStringError, which converts
through inconvertibleErrorCode() to -32603, so clients could not tell a
misspelled method from a server fault. Use the MethodNotFound error,
which already carries -32601, and give InvalidParams the -32602 code it
was missing.

(cherry picked from commit 16f116f)
A debugger created for an MCP session has no event loop to service
asynchronous stops, so a resume returned before the process stopped and
every subsequent command failed against a still-running process. That
made breakpoint debugging unusable: `run` reported only the launch, and
`bt` that followed it errored out. Create these debuggers in synchronous
mode, as lldb-dap does.

(cherry picked from commit 58a93a1)
@JDevlieghere
JDevlieghere requested a review from a team as a code owner July 29, 2026 18:33
@JDevlieghere

Copy link
Copy Markdown
Author

@swift-ci test

@JDevlieghere

Copy link
Copy Markdown
Author

@swift-ci test

@JDevlieghere

Copy link
Copy Markdown
Author

@swift-ci test Windows

@JDevlieghere

Copy link
Copy Markdown
Author

@swift-ci test macOS

@JDevlieghere

Copy link
Copy Markdown
Author

Failing to build Foundation?

@swift-ci test Windows

@JDevlieghere

Copy link
Copy Markdown
Author

@swift-ci test Windows

@JDevlieghere
JDevlieghere merged commit 1ffedf7 into swiftlang:stable/21.x Aug 2, 2026
3 checks passed
@JDevlieghere
JDevlieghere deleted the jdevlieghere/mcp-fixes-21.x branch August 2, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant