HomePhabricator

[lldb] [Process/gdb-remote] Use '127.0.0.1' in ConnectLocally()

Authored by mgorny on Mar 3 2019, 4:42 AM.

Description

[lldb] [Process/gdb-remote] Use '127.0.0.1' in ConnectLocally()

Use '127.0.0.1' instead of 'localhost' in ConnectLocally() function
as this is the specific address the server is bound to. Using
'localhost' may involve trying IPv6 first which may accidentally be used
by another service.

While technically it might be interesting to support IPv6 here, it would
need to be supported properly, with the connection copying family
and address from the listening socket, and possibly without relying
on existence of 'localhost' at all.

Differential Revision: https://reviews.llvm.org/D58883

llvm-svn: 355285