[lldb-mcp] Run managed debug sessions synchronously (#212681)

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.
This commit is contained in:
Jonas Devlieghere 2026-07-29 13:13:00 -05:00 committed by GitHub
parent 16f116f476
commit 58a93a1eec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -183,6 +183,10 @@ DebuggerCreateTool::Call(const lldb_protocol::mcp::ToolArguments &) {
debugger_sp->SetOutputFile(out);
debugger_sp->SetErrorFile(out);
// A debugger driven over MCP has no event loop to service asynchronous
// stops, so a resume must not return before the process has stopped.
debugger_sp->SetAsyncExecution(false);
return createTextResult(to_uri(debugger_sp));
}