Skip to content

Conversation

ashgti
Copy link
Contributor

@ashgti ashgti commented Aug 27, 2025

Moving lldb_protocol::mcp::MCPTransport out of Server.h and into its own file and simplifying the name to Transport.

Moving `lldb_protocol::mcp::MCPTransport` out of Server.h and into its own file and simplifying the name to `Transport`.
@ashgti ashgti requested a review from JDevlieghere as a code owner August 27, 2025 22:39
@llvmbot llvmbot added the lldb label Aug 27, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 27, 2025

@llvm/pr-subscribers-lldb

Author: John Harrison (ashgti)

Changes

Moving lldb_protocol::mcp::MCPTransport out of Server.h and into its own file and simplifying the name to Transport.


Full diff: https://github.com/llvm/llvm-project/pull/155711.diff

9 Files Affected:

  • (modified) lldb/include/lldb/Protocol/MCP/MCPError.h (+1-4)
  • (modified) lldb/include/lldb/Protocol/MCP/Protocol.h (+5)
  • (modified) lldb/include/lldb/Protocol/MCP/Server.h (+4-27)
  • (added) lldb/include/lldb/Protocol/MCP/Transport.h (+39)
  • (modified) lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp (+1-1)
  • (modified) lldb/source/Protocol/MCP/CMakeLists.txt (+1)
  • (modified) lldb/source/Protocol/MCP/Server.cpp (+3-3)
  • (added) lldb/source/Protocol/MCP/Transport.cpp (+32)
  • (modified) lldb/unittests/Protocol/ProtocolMCPServerTest.cpp (+4-3)
diff --git a/lldb/include/lldb/Protocol/MCP/MCPError.h b/lldb/include/lldb/Protocol/MCP/MCPError.h
index 55dd40f124a15..52c5a78fa23c0 100644
--- a/lldb/include/lldb/Protocol/MCP/MCPError.h
+++ b/lldb/include/lldb/Protocol/MCP/MCPError.h
@@ -19,7 +19,7 @@ class MCPError : public llvm::ErrorInfo<MCPError> {
 public:
   static char ID;
 
-  MCPError(std::string message, int64_t error_code = kInternalError);
+  MCPError(std::string message, int64_t error_code = eErrorCodeInternalError);
 
   void log(llvm::raw_ostream &OS) const override;
   std::error_code convertToErrorCode() const override;
@@ -28,9 +28,6 @@ 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;
diff --git a/lldb/include/lldb/Protocol/MCP/Protocol.h b/lldb/include/lldb/Protocol/MCP/Protocol.h
index 6e1ffcbe1f3e3..295f1f6e1b037 100644
--- a/lldb/include/lldb/Protocol/MCP/Protocol.h
+++ b/lldb/include/lldb/Protocol/MCP/Protocol.h
@@ -55,6 +55,11 @@ enum ErrorCode : signed {
   eErrorCodeInvalidParams = -32602,
   /// Internal JSON-RPC error.
   eErrorCodeInternalError = -32603,
+
+  /// Additional MCP error codes.
+
+  /// Resource related uri not found.
+  eErrorCodeResourceNotFound = -32002,
 };
 
 struct Error {
diff --git a/lldb/include/lldb/Protocol/MCP/Server.h b/lldb/include/lldb/Protocol/MCP/Server.h
index aa5714e45755e..009c574fde92f 100644
--- a/lldb/include/lldb/Protocol/MCP/Server.h
+++ b/lldb/include/lldb/Protocol/MCP/Server.h
@@ -9,43 +9,20 @@
 #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 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 {
+class Server : public Transport::MessageHandler {
 public:
   Server(std::string name, std::string version,
-         std::unique_ptr<MCPTransport> transport_up,
-         lldb_private::MainLoop &loop);
+         std::unique_ptr<Transport> transport_up, lldb_private::MainLoop &loop);
   ~Server() = default;
 
   using NotificationHandler = std::function<void(const Notification &)>;
@@ -92,7 +69,7 @@ class Server : public MCPTransport::MessageHandler {
   const std::string m_name;
   const std::string m_version;
 
-  std::unique_ptr<MCPTransport> m_transport_up;
+  std::unique_ptr<Transport> m_transport_up;
   lldb_private::MainLoop &m_loop;
 
   llvm::StringMap<std::unique_ptr<Tool>> m_tools;
diff --git a/lldb/include/lldb/Protocol/MCP/Transport.h b/lldb/include/lldb/Protocol/MCP/Transport.h
new file mode 100644
index 0000000000000..3cb725131f3b0
--- /dev/null
+++ b/lldb/include/lldb/Protocol/MCP/Transport.h
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_PROTOCOL_MCP_TRANSPORT_H
+#define LLDB_PROTOCOL_MCP_TRANSPORT_H
+
+#include "lldb/Host/JSONTransport.h"
+#include "lldb/Protocol/MCP/Protocol.h"
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/StringRef.h"
+#include <functional>
+#include <string>
+
+namespace lldb_protocol::mcp {
+
+class Transport
+    : public lldb_private::JSONRPCTransport<Request, Response, Notification> {
+public:
+  using LogCallback = std::function<void(llvm::StringRef message)>;
+
+  Transport(lldb::IOObjectSP in, lldb::IOObjectSP out, std::string client_name,
+            LogCallback log_callback = {});
+  virtual ~Transport() = default;
+
+  void Log(llvm::StringRef message) override;
+
+private:
+  std::string m_client_name;
+  LogCallback m_log_callback;
+};
+
+} // namespace lldb_protocol::mcp
+
+#endif
diff --git a/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp b/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp
index 57132534cf680..a9c4164313a6d 100644
--- a/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp
+++ b/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp
@@ -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::MCPTransport>(
+  auto transport_up = std::make_unique<lldb_protocol::mcp::Transport>(
       io_sp, io_sp, std::move(client_name), [&](llvm::StringRef message) {
         LLDB_LOG(GetLog(LLDBLog::Host), "{0}", message);
       });
diff --git a/lldb/source/Protocol/MCP/CMakeLists.txt b/lldb/source/Protocol/MCP/CMakeLists.txt
index a73e7e6a7cab1..23da62085537e 100644
--- a/lldb/source/Protocol/MCP/CMakeLists.txt
+++ b/lldb/source/Protocol/MCP/CMakeLists.txt
@@ -3,6 +3,7 @@ add_lldb_library(lldbProtocolMCP NO_PLUGIN_DEPENDENCIES
   Protocol.cpp
   Server.cpp
   Tool.cpp
+  Transport.cpp
 
   LINK_COMPONENTS
     Support
diff --git a/lldb/source/Protocol/MCP/Server.cpp b/lldb/source/Protocol/MCP/Server.cpp
index 63c2d01d17922..fb317083b015e 100644
--- a/lldb/source/Protocol/MCP/Server.cpp
+++ b/lldb/source/Protocol/MCP/Server.cpp
@@ -15,7 +15,7 @@ using namespace lldb_protocol::mcp;
 using namespace llvm;
 
 Server::Server(std::string name, std::string version,
-               std::unique_ptr<MCPTransport> transport_up,
+               std::unique_ptr<Transport> 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) {
@@ -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(),
-      MCPError::kResourceNotFound);
+      eErrorCodeResourceNotFound);
 }
 
 ServerCapabilities Server::GetCapabilities() {
@@ -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 = MCPError::kInternalError;
+        protocol_error.code = eErrorCodeInternalError;
         protocol_error.message = err.message();
       });
   Response error_response;
diff --git a/lldb/source/Protocol/MCP/Transport.cpp b/lldb/source/Protocol/MCP/Transport.cpp
new file mode 100644
index 0000000000000..58c66af7320ed
--- /dev/null
+++ b/lldb/source/Protocol/MCP/Transport.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Protocol/MCP/Transport.h"
+#include "lldb/Host/JSONTransport.h"
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/FormatVariadic.h"
+#include <string>
+#include <utility>
+
+using namespace llvm;
+using namespace lldb;
+
+namespace lldb_protocol::mcp {
+
+Transport::Transport(IOObjectSP in, IOObjectSP out, std::string client_name,
+                     LogCallback log_callback)
+    : JSONRPCTransport(in, out), m_client_name(std::move(client_name)),
+      m_log_callback(log_callback) {}
+
+void Transport::Log(StringRef message) {
+  if (m_log_callback)
+    m_log_callback(formatv("{0}: {1}", m_client_name, message).str());
+}
+
+} // namespace lldb_protocol::mcp
diff --git a/lldb/unittests/Protocol/ProtocolMCPServerTest.cpp b/lldb/unittests/Protocol/ProtocolMCPServerTest.cpp
index 9fa446133d46f..846582ab9a74e 100644
--- a/lldb/unittests/Protocol/ProtocolMCPServerTest.cpp
+++ b/lldb/unittests/Protocol/ProtocolMCPServerTest.cpp
@@ -21,6 +21,7 @@
 #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"
@@ -36,12 +37,12 @@ using namespace lldb_private;
 using namespace lldb_protocol::mcp;
 
 namespace {
-class TestMCPTransport final : public MCPTransport {
+class TestMCPTransport final : public lldb_protocol::mcp::Transport {
 public:
   TestMCPTransport(lldb::IOObjectSP in, lldb::IOObjectSP out)
-      : lldb_protocol::mcp::MCPTransport(in, out, "unittest") {}
+      : lldb_protocol::mcp::Transport(in, out, "unittest") {}
 
-  using MCPTransport::Write;
+  using Transport::Write;
 
   void Log(llvm::StringRef message) override {
     log_messages.emplace_back(message);

Copy link
Member

@JDevlieghere JDevlieghere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@ashgti ashgti merged commit 71a065e into llvm:main Aug 27, 2025
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 27, 2025

LLVM Buildbot has detected a new failure on builder lldb-x86_64-debian running on lldb-x86_64-debian while building lldb at step 4 "build".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/29889

Here is the relevant piece of the build log for the reference
Step 4 (build) failure: build (failure)
...
502.276 [1016/72/5778] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/EPCIndirectionUtils.cpp.o
502.440 [1015/72/5779] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/MachO.cpp.o
502.452 [1014/72/5780] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/Layer.cpp.o
502.678 [1013/72/5781] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/MemoryMapper.cpp.o
502.719 [1012/72/5782] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/SectCreate.cpp.o
503.079 [1011/72/5783] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/IRPartitionLayer.cpp.o
503.192 [1010/72/5784] Building CXX object lib/DWARFLinker/CMakeFiles/LLVMDWARFLinker.dir/Utils.cpp.o
503.359 [1009/72/5785] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/JITLinkReentryTrampolines.cpp.o
503.586 [1008/72/5786] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/DXContainer/DXContainerObject.cpp.o
503.614 [1007/72/5787] Linking CXX shared library lib/liblldb.so.22.0.0git
FAILED: lib/liblldb.so.22.0.0git 
: && /usr/bin/clang++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-vla-extension -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=gold   -Wl,--gc-sections  -Wl,--version-script,"/home/worker/2.0.1/lldb-x86_64-debian/build/tools/lldb/source/API/liblldb.exports"  -Xlinker --dependency-file=tools/lldb/source/API/CMakeFiles/liblldb.dir/link.d -shared -Wl,-soname,liblldb.so.22.0git -o lib/liblldb.so.22.0.0git tools/lldb/source/API/CMakeFiles/liblldb.dir/SBAddress.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBAddressRange.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBAddressRangeList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBAttachInfo.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBlock.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpoint.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpointLocation.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpointName.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpointOptionCommon.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBroadcaster.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCommandInterpreter.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCommandInterpreterRunOptions.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCommandReturnObject.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCommunication.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCompileUnit.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBData.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBDebugger.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBDeclaration.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBEnvironment.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBError.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBEvent.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBExecutionContext.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBExpressionOptions.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFile.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFileSpec.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFileSpecList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFormat.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFrame.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFunction.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBHostOS.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBInstruction.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBInstructionList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBLanguageRuntime.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBLaunchInfo.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBLineEntry.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBListener.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBMemoryRegionInfo.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBMemoryRegionInfoList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBModule.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBModuleSpec.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBMutex.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBPlatform.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBProcess.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBProcessInfo.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBProcessInfoList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBProgress.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBQueue.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBQueueItem.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.
dir/SBReproducer.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSaveCoreOptions.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBScriptObject.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSection.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSourceManager.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBStatisticsOptions.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBStream.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBStringList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBStructuredData.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSymbol.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSymbolContext.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSymbolContextList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTarget.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBThread.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBThreadCollection.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBThreadPlan.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTrace.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTraceCursor.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBType.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeCategory.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeEnumMember.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeFilter.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeFormat.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeNameSpecifier.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeSummary.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeSynthetic.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBUnixSignals.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBValue.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBValueList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBVariablesOptions.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBWatchpoint.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBWatchpointOptions.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SystemInitializerFull.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/__/__/bindings/python/LLDBWrapPython.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:"  lib/liblldbBreakpoint.a  lib/liblldbCore.a  lib/liblldbDataFormatters.a  lib/liblldbExpression.a  lib/liblldbHost.a  lib/liblldbInitialization.a  lib/liblldbInterpreter.a  lib/liblldbSymbol.a  lib/liblldbTarget.a  lib/liblldbUtility.a  lib/liblldbValueObject.a  lib/liblldbVersion.a  lib/liblldbPluginABIAArch64.a  lib/liblldbPluginABIARM.a  lib/liblldbPluginABIHexagon.a  lib/liblldbPluginABILoongArch.a  lib/liblldbPluginABIMips.a  lib/liblldbPluginABIMSP430.a  lib/liblldbPluginABIPowerPC.a  lib/liblldbPluginABIRISCV.a  lib/liblldbPluginABISystemZ.a  lib/liblldbPluginABIX86.a  lib/liblldbPluginArchitectureArm.a  lib/liblldbPluginArchitectureMips.a  lib/liblldbPluginArchitecturePPC64.a  lib/liblldbPluginArchitectureAArch64.a  lib/liblldbPluginDisassemblerLLVMC.a  lib/liblldbPluginDynamicLoaderDarwinKernel.a  lib/liblldbPluginDynamicLoaderFreeBSDKernel.a  lib/liblldbPluginDynamicLoaderMacOSXDYLD.a  lib/liblldbPluginDynamicLoaderPosixDYLD.a  lib/liblldbPluginDynamicLoaderStatic.a  lib/liblldbPluginDynamicLoaderHexagonDYLD.a  lib/liblldbPluginDynamicLoaderWindowsDYLD.a  lib/liblldbPluginDynamicLoaderWasmDYLD.a  lib/liblldbPluginInstructionARM.a  lib/liblldbPluginInstructionARM64.a  lib/liblldbPluginInstructionLoongArch.a  lib/liblldbPluginInstructionMIPS.a  lib/liblldbPluginInstructionMIPS64.a  lib/liblldbPluginInstructionPPC64.a  lib/liblldbPluginInstructionRISCV.a  lib/liblldbPluginInstrumentationRuntimeASan.a  lib/liblldbPluginInstrumentationRuntimeASanLibsanitizers.a  lib/liblldbPluginInstrumentationRuntimeMainThreadChecker.a  lib/liblldbPluginInstrumentationRuntimeTSan.a  lib/liblldbPluginInstrumentationRuntimeUBSan.a  lib/liblldbPluginJITLoaderGDB.a  lib/liblldbPluginCPlusPlusLanguage.a  lib/liblldbPluginObjCLanguage.a  lib/liblldbPluginObjCPlusPlusLanguage.a  lib/liblldbPluginCXXItaniumABI.a  lib/liblldbPluginAppleObjCRuntime.a  

Desc.a  lib/libLLVMSPIRVInfo.a  lib/libLLVMSystemZCodeGen.a  lib/libLLVMSystemZAsmParser.a  lib/libLLVMSystemZDisassembler.a  lib/libLLVMSystemZDesc.a  lib/libLLVMSystemZInfo.a  lib/libLLVMVECodeGen.a  lib/libLLVMVEAsmParser.a  lib/libLLVMVEDesc.a  lib/libLLVMVEDisassembler.a  lib/libLLVMVEInfo.a  lib/libLLVMWebAssemblyCodeGen.a  lib/libLLVMWebAssemblyAsmParser.a  lib/libLLVMWebAssemblyDisassembler.a  lib/libLLVMWebAssemblyUtils.a  lib/libLLVMWebAssemblyDesc.a  lib/libLLVMWebAssemblyInfo.a  lib/libLLVMX86CodeGen.a  lib/libLLVMX86AsmParser.a  lib/libLLVMX86Desc.a  lib/libLLVMX86Disassembler.a  lib/libLLVMX86Info.a  lib/libLLVMXCoreCodeGen.a  lib/libLLVMXCoreDesc.a  lib/libLLVMXCoreDisassembler.a  lib/libLLVMXCoreInfo.a  lib/libLLVMMipsCodeGen.a  lib/libLLVMAsmPrinter.a  lib/libLLVMMipsAsmParser.a  lib/libLLVMMipsDesc.a  lib/libLLVMMipsDisassembler.a  lib/libLLVMMipsInfo.a  lib/liblldbPluginInstrumentationRuntimeUtility.a  lib/liblldbPluginObjectContainerMachOFileset.a  lib/liblldbPluginPlatformPOSIX.a  lib/liblldbPluginPlatformGDB.a  lib/liblldbPluginProcessGDBRemote.a  lib/liblldbPluginDynamicLoaderDarwinKernel.a  lib/liblldbPluginDynamicLoaderMacOSXDYLD.a  lib/liblldbPluginObjectFileMachO.a  lib/liblldbPluginObjectFilePlaceholder.a  lib/liblldbPluginDynamicLoaderPosixDYLD.a  lib/liblldbPluginProcessElfCore.a  lib/liblldbPluginDynamicLoaderPosixDYLD.a  lib/liblldbPluginProcessElfCore.a  lib/liblldbPluginScriptInterpreterPythonInterfaces.a  /usr/lib/x86_64-linux-gnu/libpython3.13.so  lib/liblldbPluginObjectFileBreakpad.a  lib/libLLVMDebuginfod.a  lib/liblldbPluginObjectFileELF.a  lib/liblldbPluginObjectFilePECOFF.a  lib/liblldbPluginObjectFileWasm.a  lib/liblldbPluginTraceExporterCommon.a  lib/liblldbBreakpoint.a  lib/liblldbCore.a  lib/liblldbDataFormatters.a  lib/liblldbExpression.a  lib/liblldbInterpreter.a  lib/liblldbSymbol.a  lib/liblldbTarget.a  lib/liblldbValueObject.a  lib/liblldbPluginCPlusPlusLanguage.a  lib/liblldbPluginObjCLanguage.a  lib/liblldbPluginAppleObjCRuntime.a  lib/liblldbPluginObjectFilePDB.a  lib/liblldbPluginSymbolFileDWARF.a  lib/liblldbPluginSymbolFilePDB.a  lib/liblldbPluginTypeSystemClang.a  lib/liblldbCommands.a  lib/liblldbPluginProcessUtility.a  lib/liblldbPluginClangCommon.a  lib/liblldbPluginCPPRuntime.a  lib/liblldbPluginExpressionParserClang.a  lib/liblldbPluginSymbolFileNativePDB.a  lib/liblldbPluginObjCRuntime.a  lib/liblldbBreakpoint.a  lib/liblldbCore.a  lib/liblldbDataFormatters.a  lib/liblldbExpression.a  lib/liblldbInterpreter.a  lib/liblldbSymbol.a  lib/liblldbTarget.a  lib/liblldbValueObject.a  lib/liblldbPluginCPlusPlusLanguage.a  lib/liblldbPluginObjCLanguage.a  lib/liblldbPluginAppleObjCRuntime.a  lib/liblldbPluginObjectFilePDB.a  lib/liblldbPluginSymbolFileDWARF.a  lib/liblldbPluginSymbolFilePDB.a  lib/liblldbPluginTypeSystemClang.a  lib/liblldbCommands.a  lib/liblldbPluginProcessUtility.a  lib/liblldbPluginClangCommon.a  lib/liblldbPluginCPPRuntime.a  lib/liblldbPluginExpressionParserClang.a  lib/liblldbPluginSymbolFileNativePDB.a  lib/liblldbPluginObjCRuntime.a  lib/liblldbBreakpoint.a  lib/liblldbCore.a  lib/liblldbDataFormatters.a  lib/liblldbExpression.a  lib/liblldbInterpreter.a  lib/liblldbSymbol.a  lib/liblldbTarget.a  lib/liblldbValueObject.a  lib/liblldbPluginCPlusPlusLanguage.a  lib/liblldbPluginObjCLanguage.a  lib/liblldbPluginAppleObjCRuntime.a  lib/liblldbPluginObjectFilePDB.a  lib/liblldbPluginSymbolFileDWARF.a  lib/liblldbPluginSymbolFilePDB.a  lib/liblldbPluginTypeSystemClang.a  lib/liblldbCommands.a  lib/liblldbPluginProcessUtility.a  lib/liblldbPluginClangCommon.a  lib/liblldbPluginCPPRuntime.a  lib/liblldbPluginExpressionParserClang.a  lib/liblldbPluginSymbolFileNativePDB.a  lib/liblldbPluginObjCRuntime.a  lib/liblldbBreakpoint.a  lib/liblldbCore.a  lib/liblldbDataFormatters.a  lib/liblldbExpression.a  lib/liblldbInterpreter.a  lib/liblldbSymbol.a  lib/liblldbTarget.a  lib/liblldbValueObject.a  lib/liblldbPluginCPlusPlusLanguage.a  lib/liblldbPluginObjCLanguage.a  lib/liblldbPluginAppleObjCRuntime.a  lib/liblldbPluginObjectFilePDB.a  lib/liblldbPluginS
ymbolFileDWARF.a  lib/liblldbPluginSymbolFilePDB.a  lib/liblldbPluginTypeSystemClang.a  lib/liblldbCommands.a  lib/liblldbPluginProcessUtility.a  lib/liblldbPluginClangCommon.a  lib/liblldbPluginCPPRuntime.a  lib/liblldbPluginExpressionParserClang.a  lib/liblldbPluginSymbolFileNativePDB.a  lib/liblldbPluginObjCRuntime.a  lib/liblldbBreakpoint.a  lib/liblldbCore.a  lib/liblldbDataFormatters.a  lib/liblldbExpression.a  lib/liblldbInterpreter.a  lib/liblldbSymbol.a  lib/liblldbTarget.a  lib/liblldbValueObject.a  lib/liblldbPluginCPlusPlusLanguage.a  lib/liblldbPluginObjCLanguage.a  lib/liblldbPluginAppleObjCRuntime.a  lib/liblldbPluginObjectFilePDB.a  lib/liblldbPluginSymbolFileDWARF.a  lib/liblldbPluginSymbolFilePDB.a  lib/liblldbPluginTypeSystemClang.a  lib/liblldbCommands.a  lib/liblldbPluginProcessUtility.a  lib/liblldbPluginClangCommon.a  lib/liblldbPluginCPPRuntime.a  lib/liblldbPluginExpressionParserClang.a  lib/liblldbPluginSymbolFileNativePDB.a  lib/liblldbPluginObjCRuntime.a  /usr/lib/x86_64-linux-gnu/libpanel.so  -lcurses  /usr/lib/x86_64-linux-gnu/libform.so  lib/libLLVMTelemetry.a  lib/liblldbInterpreterInterfaces.a  lib/liblldbVersion.a  lib/libLLVMMCJIT.a  lib/libLLVMExecutionEngine.a  lib/libLLVMOrcTargetProcess.a  lib/libLLVMOrcShared.a  lib/libLLVMRuntimeDyld.a  lib/libclangCodeGen.a  lib/libLLVMCoverage.a  lib/libLLVMFrontendDriver.a  lib/libLLVMLTO.a  lib/libLLVMPasses.a  lib/libLLVMCFGuard.a  lib/libLLVMGlobalISel.a  lib/libLLVMSelectionDAG.a  lib/libLLVMCodeGen.a  lib/libLLVMTarget.a  lib/libLLVMCodeGenTypes.a  lib/libLLVMHipStdPar.a  lib/libLLVMIRPrinter.a  lib/libLLVMObjCARCOpts.a  lib/libLLVMCoroutines.a  lib/libLLVMipo.a  lib/libLLVMVectorize.a  lib/libLLVMSandboxIR.a  lib/libLLVMInstrumentation.a  lib/libLLVMCGData.a  lib/libLLVMBitWriter.a  lib/libLLVMLinker.a  lib/libLLVMExtensions.a  lib/libclangRewriteFrontend.a  lib/libclangFrontend.a  lib/libclangDriver.a  lib/libLLVMWindowsDriver.a  lib/libLLVMOption.a  lib/libclangParse.a  lib/libclangRewrite.a  lib/libclangSerialization.a  lib/libclangSema.a  lib/libclangEdit.a  lib/libclangAPINotes.a  lib/libclangAnalysis.a  lib/libclangASTMatchers.a  lib/libclangSupport.a  lib/libclangAST.a  lib/libclangLex.a  lib/libclangBasic.a  lib/libLLVMFrontendOpenMP.a  lib/libLLVMScalarOpts.a  lib/libLLVMAggressiveInstCombine.a  lib/libLLVMInstCombine.a  lib/libLLVMFrontendOffloading.a  lib/libLLVMTransformUtils.a  lib/libLLVMObjectYAML.a  lib/libLLVMFrontendAtomic.a  lib/libLLVMAnalysis.a  lib/libLLVMProfileData.a  lib/libLLVMSymbolize.a  lib/libLLVMDebugInfoPDB.a  lib/libLLVMDebugInfoMSF.a  lib/libLLVMDebugInfoGSYM.a  lib/libLLVMDebugInfoDWARF.a  lib/libLLVMDebugInfoDWARFLowLevel.a  lib/libLLVMDebugInfoBTF.a  lib/libLLVMFrontendHLSL.a  lib/libLLVMFrontendDirective.a  lib/libLLVMDebugInfoCodeView.a  lib/libLLVMMCDisassembler.a  lib/liblldbHost.a  /usr/lib/x86_64-linux-gnu/libxml2.so  /usr/lib/x86_64-linux-gnu/libedit.so  lib/libLLVMObject.a  lib/libLLVMIRReader.a  lib/libLLVMBitReader.a  lib/libLLVMAsmParser.a  lib/libLLVMCore.a  lib/libLLVMRemarks.a  lib/libLLVMBitstreamReader.a  lib/libLLVMMCParser.a  lib/libLLVMMC.a  lib/libLLVMTextAPI.a  lib/liblldbProtocolMCP.a  lib/liblldbUtility.a  lib/libLLVMBinaryFormat.a  lib/libLLVMTargetParser.a  lib/libLLVMSupport.a  lib/libLLVMDemangle.a  -ldl  /usr/lib/x86_64-linux-gnu/libz.so  -lrt  -lm && :
lib/liblldbProtocolMCP.a(Transport.cpp.o):Transport.cpp:function lldb_private::JSONTransport<lldb_protocol::mcp::Request, lldb_protocol::mcp::Response, lldb_protocol::mcp::Notification>::OnRead(lldb_private::MainLoopBase&, lldb_private::Transport<lldb_protocol::mcp::Request, lldb_protocol::mcp::Response, lldb_protocol::mcp::Notification>::MessageHandler&):(.text._ZN12lldb_private13JSONTransportIN13lldb_protocol3mcp7RequestENS2_8ResponseENS2_12NotificationEE6OnReadERNS_12MainLoopBaseERNS_9TransportIS3_S4_S5_E14MessageHandlerE+0x575): error: undefined reference to 'lldb_private::TransportUnhandledContentsError::TransportUnhandledContentsError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
503.650 [1007/71/5788] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/DXContainer/DXContainerWriter.cpp.o
503.747 [1007/70/5789] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/DXContainer/DXContainerReader.cpp.o
503.913 [1007/69/5790] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/DebugObjectManagerPlugin.cpp.o
504.280 [1007/68/5791] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/UnwindInfoRegistrationPlugin.cpp.o
504.290 [1007/67/5792] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/DXContainer/DXContainerObjcopy.cpp.o
504.332 [1007/66/5793] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/ConfigManager.cpp.o
504.369 [1007/65/5794] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/RTDyldObjectLinkingLayer.cpp.o
504.381 [1007/64/5795] Building CXX object lib/DWARFLinker/CMakeFiles/LLVMDWARFLinker.dir/DWARFLinkerBase.cpp.o
504.399 [1007/63/5796] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/CommonConfig.cpp.o
504.642 [1007/62/5797] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/COFF/COFFReader.cpp.o
504.654 [1007/61/5798] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/COFF/COFFWriter.cpp.o
504.678 [1007/60/5799] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/Archive.cpp.o
504.801 [1007/59/5800] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StreamChecker.cpp.o
504.814 [1007/58/5801] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/UninitializedObject/UninitializedObjectChecker.cpp.o
504.845 [1007/57/5802] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/JITLinkRedirectableSymbolManager.cpp.o
504.973 [1007/56/5803] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/Speculation.cpp.o
504.984 [1007/55/5804] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/InterpolatingCompilationDatabase.cpp.o
505.043 [1007/54/5805] Building CXX object tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/obj.clangStaticAnalyzerFrontend.dir/ModelConsumer.cpp.o
505.215 [1007/53/5806] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/COFF/COFFObject.cpp.o
505.227 [1007/52/5807] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/ReOptimizeLayer.cpp.o
505.231 [1007/51/5808] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/COFF/COFFObjcopy.cpp.o
505.248 [1007/50/5809] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/FixIt.cpp.o
505.270 [1007/49/5810] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/LinkGraphLinkingLayer.cpp.o
505.274 [1007/48/5811] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/wasm/WasmObject.cpp.o
505.411 [1007/47/5812] Building CXX object tools/lld/Common/CMakeFiles/lldCommon.dir/ErrorHandler.cpp.o
505.516 [1007/46/5813] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/ObjCopy.cpp.o
505.717 [1007/45/5814] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/ExecutionUtils.cpp.o
506.157 [1007/44/5815] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/WebKit/MemoryUnsafeCastChecker.cpp.o
506.212 [1007/43/5816] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/SimpleRemoteEPC.cpp.o
506.288 [1007/42/5817] Building CXX object lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/MachO/MachOLayoutBuilder.cpp.o
506.309 [1007/41/5818] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/COFFPlatform.cpp.o

@sylvestre
Copy link
Collaborator

i had to revert it
#155822

@mstorsjo
Copy link
Member

The revert here broke building lldb-mcp which was added in #155708. Due to the conflict between that file and this PR, it required a separate renaming fix in #155720. But after this was reverted, then #155720 also needs to be reverted. So I pushed 5f3e2b6 which should fix the build again.

@nikic
Copy link
Contributor

nikic commented Aug 28, 2025

FYI #155811 was the fix for the build error...

t-a-james pushed a commit to t-a-james/llvm-project that referenced this pull request Aug 28, 2025
…oject into bugprone-method-hiding

* 'bugprone-method-hiding' of github.com:t-a-james/llvm-project: (230 commits)
  [SimplifyCFG] Move token type check into canReplaceOperandWithVariable()
  [ADT] Fix signed integer overflow (llvm#155826)
  [Offload] Update LIBOMPTARGET_INFO text for `attach` map-type. (llvm#155509)
  [CMake][AIX] Enable CMP0182: Create shared library archives by default (llvm#155686)
  AMDGPU: Add tests for atomics with AGPR operands (llvm#155820)
  [AArch64] Split zero cycle zeoring per register class (llvm#154561)
  [gn build] Port fa883e1
  [mlir][tosa] Allow shift operand of tosa::MulOp as non-constant (llvm#155197)
  [AArch64][NFC] Add MCInstrAnalysis unittests (llvm#155609)
  [Offload][OpenMP] Tests require libc on GPU for printf (llvm#155785)
  AMDGPU: Add missing verifier tests for load/store AGPR case (llvm#155815)
  [lldb-mcp] Fix building for Windows
  Revert "[lldb] Correct a usage after a rename was merged. (llvm#155720)"
  Revert "[lldb] NFC Moving mcp::Transport into its own file. (llvm#155711)"
  [lldb][test] Run ranges::ref_vew test only for libc++ (llvm#155813)
  [SCCP][FuncSpec] Poison unreachable constant global variable user (llvm#155753)
  [LoongArch] Lowering v32i8 vector mask generation to `VMSKLTZ` (llvm#149953)
  [flang][docs][NFC] Remove stray backtick (llvm#154974)
  [MLIR] Apply clang-tidy fixes for misc-use-internal-linkage in LinalgOps.cpp (NFC)
  [MLIR] Apply clang-tidy fixes for performance-move-const-arg in VariantValue.cpp (NFC)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants