[Lldb-commits] [lldb] [lldb] Make MCP server instance global (PR #145616)
John Harrison via lldb-commits
lldb-commits at lists.llvm.org
Wed Jun 25 09:08:40 PDT 2025
================
@@ -37,20 +37,26 @@ class Tool {
std::string m_description;
};
-class LLDBCommandTool : public mcp::Tool {
+class CommandTool : public mcp::Tool {
public:
- LLDBCommandTool(std::string name, std::string description,
- Debugger &debugger);
- ~LLDBCommandTool() = default;
+ using mcp::Tool::Tool;
+ ~CommandTool() = default;
virtual llvm::Expected<protocol::TextResult>
- Call(const llvm::json::Value &args) override;
+ Call(const llvm::json::Value *args) override;
----------------
ashgti wrote:
Do you know why this changed from `const json::Value &` to `const json::Value *`? Is that to support no arguments as a `nullptr`? In lldb-dap, I use a `std::monostate` to mark empty arguments (see https://github.com/llvm/llvm-project/blob/029823a84de90e3245d20e238509e13704ea5123/lldb/tools/lldb-dap/Protocol/ProtocolBase.h#L157 and https://github.com/llvm/llvm-project/blob/a76448c27de2fc110c0fe2dac9120d225aee6d39/lldb/tools/lldb-dap/Handler/RequestHandler.h#L114C1-L119C1).
I wonder if that would be helpful here, but no changes required, just trying to understand the change.
https://github.com/llvm/llvm-project/pull/145616
More information about the lldb-commits
mailing list