[Lldb-commits] [lldb] [lldb-dap] Added "port" property to vscode "attach" command. (PR #91570)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 11 01:27:41 PDT 2024


================
@@ -672,9 +672,14 @@ void request_attach(const llvm::json::Object &request) {
   lldb::SBError error;
   FillResponse(request, response);
   lldb::SBAttachInfo attach_info;
+  const int invalid_port = 0;
   auto arguments = request.getObject("arguments");
   const lldb::pid_t pid =
       GetUnsigned(arguments, "pid", LLDB_INVALID_PROCESS_ID);
+  const auto gdb_remote_port =
+      GetUnsigned(arguments, "gdb-remote-port", invalid_port);
+  llvm::StringRef gdb_remote_hostname =
+      GetString(arguments, "gdb-remote-hostname", "localhost");
----------------
labath wrote:

There are environments (Google's (default) test environment is like that) that don't have an IPv4 stack configured (just v6), so `localhost` would be an advantage there. That said, this definitely wouldn't be the first instance of `127.0.0.1 in lldb.

FWIW, I'm of the opinion that anyone who configures `localhost` to point to something other than their local host deserves whatever is coming their way,

https://github.com/llvm/llvm-project/pull/91570


More information about the lldb-commits mailing list