LLDB mainline
lldb_protocol::mcp::ServerInfo Struct Reference

Information about this instance of lldb's MCP server for lldb-mcp to use to coordinate connecting an lldb-mcp client. More...

#include <Server.h>

Static Public Member Functions

static llvm::Expected< ServerInfoHandleWrite (const ServerInfo &)
 Writes the server info into a unique file in ~/.lldb.
static llvm::Expected< std::vector< ServerInfo > > Load ()
 Loads any server info saved in ~/.lldb.
static llvm::Error Remove (lldb::pid_t pid)
 Removes the registry entry for the instance with the given pid.

Public Attributes

std::string connection_uri
lldb::pid_t pid = LLDB_INVALID_PROCESS_ID
 Process id of the lldb instance hosting this server, used as its stable identity.

Detailed Description

Information about this instance of lldb's MCP server for lldb-mcp to use to coordinate connecting an lldb-mcp client.

Definition at line 89 of file Server.h.

Member Function Documentation

◆ Load()

Expected< std::vector< ServerInfo > > ServerInfo::Load ( )
static

Loads any server info saved in ~/.lldb.

Definition at line 107 of file Server.cpp.

References lldb_private::FileSystem::CreateDataBuffer(), lldb_private::FileSystem::DirBegin(), and lldb_private::FileSystem::Instance().

◆ Remove()

llvm::Error ServerInfo::Remove ( lldb::pid_t pid)
static

Removes the registry entry for the instance with the given pid.

The handle removes it on a clean exit, so this only prunes one orphaned by a crash.

Definition at line 98 of file Server.cpp.

References lldb_private::FileSpec::GetPath(), GetServerInfoPath(), and pid.

◆ Write()

Member Data Documentation

◆ connection_uri

std::string lldb_protocol::mcp::ServerInfo::connection_uri

Definition at line 90 of file Server.h.

Referenced by lldb_protocol::mcp::toJSON().

◆ pid

lldb::pid_t lldb_protocol::mcp::ServerInfo::pid = LLDB_INVALID_PROCESS_ID

Process id of the lldb instance hosting this server, used as its stable identity.

Definition at line 93 of file Server.h.

Referenced by Remove(), lldb_protocol::mcp::toJSON(), and Write().


The documentation for this struct was generated from the following files: