Skip to content

Commit 54922d4

Browse files
royitaqiGerritBuildBot
authored andcommitted
[LLDB] Accept connections via both "listen://" and "tcp://"
Summary: A previous [internal patch](https://www.internalfb.com/phabricator/commit/OMEXTLLVMPROJECT/76d297cbe06b80e8d71cb96daa3245ef2f65cf76) removed the support of the "listen://" protocol, and changed to "tcp://". The latter is required to support [RL use cases](https://fburl.com/code/bql6tq63). However, the removal of "listen://" cause the upstream lldb-dap VS Code extension to not work, because [they rely on this protocol](https://github.com/llvm/llvm-project/blob/7162f191b8ce68dddb60e3f129f786afb08b2bbb/lldb/tools/lldb-dap/src-ts/lldb-dap-server.ts#L29). This diff changes it so that it supports both. Test Plan: The lldb-dap supports both "listen://" and "tcp://" ``` royshi-mac-office ~/llvm-sand/gen/usr/bin % ./lldb-dap --connection listen://localhost:0 Listening for: connection://[::1]:51376, connection://[127.0.0.1]:51376 ^C% royshi-mac-office ~/llvm-sand/gen/usr/bin % ./lldb-dap --connection tcp://localhost:0 Listening for: connection://[::1]:51382, connection://[127.0.0.1]:51382 ^C% royshi-mac-office ~/llvm-sand/gen/usr/bin % ./lldb-dap --version lldb-dap: Facebook LLVM version 15.71.0 DEBUG build with assertions. liblldb: Meta lldb version 15.71.0. See https://fburl.com/lldb_updates for a list of updates. (http://git.edge.x2p.facebook.net/repos/git/rw/osmeta/external/llvm-project revision 1f0e2624ad1fc58e65c7289014c2850ea770bab3) clang revision 1f0e2624ad1fc58e65c7289014c2850ea770bab3 llvm revision 1f0e2624ad1fc58e65c7289014c2850ea770bab3 royshi-mac-office ~/llvm-sand/external/llvm-project % gitlog * 1f0e2624ad1f - (HEAD) [LLDB] Accept connections via both "listen://" and "tcp://" (44 minutes ago) <Roy Shi> * 9360e52 - (origin/toolchain/llvm-sand/next-main, m/toolchain/llvm-sand-next) Implement parallel module loading for ModuleList DYLD (2 hours ago) <George Hu> ``` Rollback Plan: Reviewers: alexandreperez, peix, wanyi, #lldb_team Reviewed By: alexandreperez Subscribers: #lldb_team Differential Revision: https://phabricator.intern.facebook.com/D79139845
1 parent 9360e52 commit 54922d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lldb/source/Host/common/Socket.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ std::optional<Socket::ProtocolModePair>
498498
Socket::GetProtocolAndMode(llvm::StringRef scheme) {
499499
// Keep in sync with ConnectionFileDescriptor::Connect.
500500
return llvm::StringSwitch<std::optional<ProtocolModePair>>(scheme)
501-
.Case("tcp", ProtocolModePair{SocketProtocol::ProtocolTcp,
502-
SocketMode::ModeAccept})
501+
.Cases("listen", "tcp", ProtocolModePair{SocketProtocol::ProtocolTcp,
502+
SocketMode::ModeAccept})
503503
.Cases("unix", "unix-accept",
504504
ProtocolModePair{SocketProtocol::ProtocolUnixDomain,
505505
SocketMode::ModeAccept})

0 commit comments

Comments
 (0)