Skip to content

Commit 8ffabe8

Browse files
committed
[lldb][mcp] Fix unix domain socket protocol server addresses
1 parent a061171 commit 8ffabe8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lldb/source/Commands/CommandObjectProtocolServer.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,12 @@ class CommandObjectProtocolServerStart : public CommandObjectParsed {
7575

7676
ProtocolServer::Connection connection;
7777
connection.protocol = protocol_and_mode->first;
78-
connection.name =
79-
formatv("[{0}]:{1}", uri->hostname.empty() ? "0.0.0.0" : uri->hostname,
80-
uri->port.value_or(0));
78+
if (connection.protocol == Socket::SocketProtocol::ProtocolUnixDomain)
79+
connection.name = uri->path;
80+
else
81+
connection.name = formatv(
82+
"[{0}]:{1}", uri->hostname.empty() ? "0.0.0.0" : uri->hostname,
83+
uri->port.value_or(0));
8184

8285
if (llvm::Error error = server->Start(connection)) {
8386
result.AppendErrorWithFormatv("{0}", llvm::fmt_consume(std::move(error)));

0 commit comments

Comments
 (0)