Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
5c58c90
[lldb] Update JSONTransport to use MainLoop for reading. (#152367)
ashgti Aug 12, 2025
77c25d6
[lldb] Disable JSONTransportTests on Windows. (#153453)
ashgti Aug 13, 2025
a0ccd95
Bump ProtocolServerMCPTest timeout to 200ms (#154182)
mysterymath Aug 18, 2025
dc3ad07
[lldb] Refactoring JSONTransport into an abstract RPC Message Handler…
ashgti Aug 19, 2025
f62d4a8
[lldb-dap] Add module symbol table viewer to VS Code extension #14062…
eronnen Aug 20, 2025
3c176e3
[lldb-dap] Re-land refactor of DebugCommunication. (#147787)
ashgti Aug 21, 2025
7ff6ac6
Revert "[lldb-dap] Re-land refactor of DebugCommunication. (#147787)"
rastogishubham Aug 21, 2025
d32d7fa
Reapply "[lldb-dap] Re-land refactor of DebugCommunication. (#147787)…
ashgti Aug 21, 2025
2097336
Revert "[lldb-dap] Add module symbol table viewer to VS Code extensio…
omjavaid Aug 22, 2025
76b380f
[lldb-dap] Migrating 'completions' to structured types. (#153317)
ashgti Aug 22, 2025
b76406f
Re-land LLDB dap module symbol tables (#155021)
eronnen Aug 23, 2025
9fe9578
[lldb] Adopt JSONTransport in the MCP Server (#155034)
JDevlieghere Aug 25, 2025
d54de4a
Revert "[lldb] Adopt JSONTransport in the MCP Server" (#155280)
JDevlieghere Aug 25, 2025
b667b39
[lldb-dap] improve symbol table style (#155097)
eronnen Aug 25, 2025
6f2dc0f
[lldb] Adopt JSONTransport in the MCP Server (Reland) (#155322)
JDevlieghere Aug 25, 2025
fa21865
[lldb] Fix a warning
kazutakahirata Aug 26, 2025
058839c
[lldb][lldb-dap] parse `pathFormat` as an optional (#155238)
da-viper Aug 26, 2025
bcbae12
[lldb] Adding structured types for existing MCP calls. (#155460)
ashgti Aug 26, 2025
0a0d8dd
[lldb][test] Disable some more failing lldb-dap tests on Windows
DavidSpickett Aug 27, 2025
a07901a
[lldb] NFC Moving mcp::Transport into its own file. (#155711)
ashgti Aug 27, 2025
4f86e78
[lldb] Add lldb-mcp scaffolding (#155708)
JDevlieghere Aug 27, 2025
039391d
[lldb] Correct a usage after a rename was merged. (#155720)
ashgti Aug 27, 2025
d07b520
Revert "[lldb] NFC Moving mcp::Transport into its own file. (#155711)"
sylvestre Aug 28, 2025
6cecb98
Revert "[lldb] Correct a usage after a rename was merged. (#155720)"
mstorsjo Aug 28, 2025
5aac02e
[lldb-mcp] Fix building for Windows
mstorsjo Aug 28, 2025
97b076c
[lldb] Add lldbHost dependency to lldbProtocolMCP (#155811)
nikic Aug 28, 2025
48aafae
[vscode-lldb] Support lldb-dap environment in debug configuration (#1…
royitaqi Aug 28, 2025
12a8679
[lldb][test] Disable TestDAP_startDebugging.py on Windows
DavidSpickett Aug 29, 2025
8e2425d
[lldb][test] Skip more of TestDAP_attach.py on Windows
DavidSpickett Aug 29, 2025
640fe8b
[lldb][test] Disable more of TestDAP_attach.py on Windows
DavidSpickett Sep 12, 2025
c3fe5d4
[lldb][test] Disable a test from TestDAP_cancel.py on Windows
DavidSpickett Sep 15, 2025
1677af5
[lldb][lldb-dap] Disable more DAP tests on Windows (#158906)
DavidSpickett Sep 16, 2025
98db3c1
[lldb][lldb-dap] Disable all lldb-dap tests on Windows on Arm (#159542)
DavidSpickett Sep 18, 2025
351fddd
[lldb-dap] Fix typescript issue in updated typescript code. (#156117)
cmtice Aug 29, 2025
da6cc56
[lldb-dap] Add `--no-lldbinit` as a CLI flag (#156131)
piyushjaiswal98 Sep 4, 2025
077192d
ensure that dap_symbol is always initialized (#156956)
lexi-nadia Sep 4, 2025
f6b1799
[lldb-dap] Destroy debugger when debug session terminates (#156231)
royitaqi Sep 4, 2025
23007f2
Default-initialize all fields of lldb_dap::protocol::Symbol. (#157150)
lexi-nadia Sep 5, 2025
e613b02
[lldb-dap] Add command line option `--connection-timeout` (#156803)
royitaqi Sep 10, 2025
facd42d
[lldb-dap] Fix test: TestDAP_server.py (#157924)
royitaqi Sep 10, 2025
7daa74e
[lldb-dap] Add invalidated event (#157530)
DrSergei Sep 11, 2025
cba6b4b
[lldb-dap] Add `debugAdapterEnv` for `attach` requests & improve rege…
royitaqi Sep 12, 2025
2c8223e
[lldb-dap] Add stdio redirection (#158609)
DrSergei Sep 16, 2025
d57bc54
[NFC][lldb-dap] Fix typo in invalidated event (#158338)
DrSergei Sep 16, 2025
77b81d2
[lldb-dap] Add memory event (#158437)
DrSergei Sep 17, 2025
236e094
[lldb-dap] Bump form-data from 4.0.1 to 4.0.4
JDevlieghere Sep 18, 2025
46e7068
[vscode-lldb] Restart server when lldb-dap binary has changed (#159797)
royitaqi Sep 23, 2025
78bbdaa
[lldb-dap] Bump the version to 0.2.17
JDevlieghere Sep 23, 2025
2ec7a75
[lldb-dap] bundle lldb-dap extension using esbuild (#160598)
matthewbastien Sep 24, 2025
50269cd
[lldb-dap] Bump the version to 0.2.18
JDevlieghere Sep 24, 2025
26278ec
[lldb-dap] DataBreakpointInfoArguments make frameId optional. (#162845)
da-viper Oct 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "[lldb] NFC Moving mcp::Transport into its own file. (llvm#155711
)"

This reverts commit 71a065e.

(cherry picked from commit 1bb8db5)
  • Loading branch information
sylvestre authored and JDevlieghere committed Oct 13, 2025
commit d07b520f7e037942fadb0af563a8c0bdc3e332e7
5 changes: 4 additions & 1 deletion lldb/include/lldb/Protocol/MCP/MCPError.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MCPError : public llvm::ErrorInfo<MCPError> {
public:
static char ID;

MCPError(std::string message, int64_t error_code = eErrorCodeInternalError);
MCPError(std::string message, int64_t error_code = kInternalError);

void log(llvm::raw_ostream &OS) const override;
std::error_code convertToErrorCode() const override;
Expand All @@ -28,6 +28,9 @@ class MCPError : public llvm::ErrorInfo<MCPError> {

lldb_protocol::mcp::Error toProtocolError() const;

static constexpr int64_t kResourceNotFound = -32002;
static constexpr int64_t kInternalError = -32603;

private:
std::string m_message;
int64_t m_error_code;
Expand Down
5 changes: 0 additions & 5 deletions lldb/include/lldb/Protocol/MCP/Protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ enum ErrorCode : signed {
eErrorCodeInvalidParams = -32602,
/// Internal JSON-RPC error.
eErrorCodeInternalError = -32603,

/// Additional MCP error codes.

/// Resource related uri not found.
eErrorCodeResourceNotFound = -32002,
};

struct Error {
Expand Down
31 changes: 27 additions & 4 deletions lldb/include/lldb/Protocol/MCP/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,43 @@
#ifndef LLDB_PROTOCOL_MCP_SERVER_H
#define LLDB_PROTOCOL_MCP_SERVER_H

#include "lldb/Host/JSONTransport.h"
#include "lldb/Host/MainLoop.h"
#include "lldb/Protocol/MCP/Protocol.h"
#include "lldb/Protocol/MCP/Resource.h"
#include "lldb/Protocol/MCP/Tool.h"
#include "lldb/Protocol/MCP/Transport.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/Error.h"
#include <mutex>

namespace lldb_protocol::mcp {

class Server : public Transport::MessageHandler {
class MCPTransport
: public lldb_private::JSONRPCTransport<Request, Response, Notification> {
public:
using LogCallback = std::function<void(llvm::StringRef message)>;

MCPTransport(lldb::IOObjectSP in, lldb::IOObjectSP out,
std::string client_name, LogCallback log_callback = {})
: JSONRPCTransport(in, out), m_client_name(std::move(client_name)),
m_log_callback(log_callback) {}
virtual ~MCPTransport() = default;

void Log(llvm::StringRef message) override {
if (m_log_callback)
m_log_callback(llvm::formatv("{0}: {1}", m_client_name, message).str());
}

private:
std::string m_client_name;
LogCallback m_log_callback;
};

class Server : public MCPTransport::MessageHandler {
public:
Server(std::string name, std::string version,
std::unique_ptr<Transport> transport_up, lldb_private::MainLoop &loop);
std::unique_ptr<MCPTransport> transport_up,
lldb_private::MainLoop &loop);
~Server() = default;

using NotificationHandler = std::function<void(const Notification &)>;
Expand Down Expand Up @@ -69,7 +92,7 @@ class Server : public Transport::MessageHandler {
const std::string m_name;
const std::string m_version;

std::unique_ptr<Transport> m_transport_up;
std::unique_ptr<MCPTransport> m_transport_up;
lldb_private::MainLoop &m_loop;

llvm::StringMap<std::unique_ptr<Tool>> m_tools;
Expand Down
39 changes: 0 additions & 39 deletions lldb/include/lldb/Protocol/MCP/Transport.h

This file was deleted.

2 changes: 1 addition & 1 deletion lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void ProtocolServerMCP::AcceptCallback(std::unique_ptr<Socket> socket) {
LLDB_LOG(log, "New MCP client connected: {0}", client_name);

lldb::IOObjectSP io_sp = std::move(socket);
auto transport_up = std::make_unique<lldb_protocol::mcp::Transport>(
auto transport_up = std::make_unique<lldb_protocol::mcp::MCPTransport>(
io_sp, io_sp, std::move(client_name), [&](llvm::StringRef message) {
LLDB_LOG(GetLog(LLDBLog::Host), "{0}", message);
});
Expand Down
1 change: 0 additions & 1 deletion lldb/source/Protocol/MCP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ add_lldb_library(lldbProtocolMCP NO_PLUGIN_DEPENDENCIES
Protocol.cpp
Server.cpp
Tool.cpp
Transport.cpp

LINK_COMPONENTS
Support
Expand Down
6 changes: 3 additions & 3 deletions lldb/source/Protocol/MCP/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using namespace lldb_protocol::mcp;
using namespace llvm;

Server::Server(std::string name, std::string version,
std::unique_ptr<Transport> transport_up,
std::unique_ptr<MCPTransport> transport_up,
lldb_private::MainLoop &loop)
: m_name(std::move(name)), m_version(std::move(version)),
m_transport_up(std::move(transport_up)), m_loop(loop) {
Expand Down Expand Up @@ -180,7 +180,7 @@ llvm::Expected<Response> Server::ResourcesReadHandler(const Request &request) {

return make_error<MCPError>(
llvm::formatv("no resource handler for uri: {0}", uri_str).str(),
eErrorCodeResourceNotFound);
MCPError::kResourceNotFound);
}

ServerCapabilities Server::GetCapabilities() {
Expand Down Expand Up @@ -219,7 +219,7 @@ void Server::Received(const Request &request) {
response.takeError(),
[&](const MCPError &err) { protocol_error = err.toProtocolError(); },
[&](const llvm::ErrorInfoBase &err) {
protocol_error.code = eErrorCodeInternalError;
protocol_error.code = MCPError::kInternalError;
protocol_error.message = err.message();
});
Response error_response;
Expand Down
32 changes: 0 additions & 32 deletions lldb/source/Protocol/MCP/Transport.cpp

This file was deleted.

7 changes: 3 additions & 4 deletions lldb/unittests/Protocol/ProtocolMCPServerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "lldb/Protocol/MCP/Resource.h"
#include "lldb/Protocol/MCP/Server.h"
#include "lldb/Protocol/MCP/Tool.h"
#include "lldb/Protocol/MCP/Transport.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/JSON.h"
Expand All @@ -37,12 +36,12 @@ using namespace lldb_private;
using namespace lldb_protocol::mcp;

namespace {
class TestMCPTransport final : public lldb_protocol::mcp::Transport {
class TestMCPTransport final : public MCPTransport {
public:
TestMCPTransport(lldb::IOObjectSP in, lldb::IOObjectSP out)
: lldb_protocol::mcp::Transport(in, out, "unittest") {}
: lldb_protocol::mcp::MCPTransport(in, out, "unittest") {}

using Transport::Write;
using MCPTransport::Write;

void Log(llvm::StringRef message) override {
log_messages.emplace_back(message);
Expand Down