================
@@ -250,6 +251,13 @@ def which(program):
     return None
 
 
+def pickrandomport():
+    """Returns a random open port."""
+    with socket.socket() as sock:
+        sock.bind(("", 0))
+        return sock.getsockname()[1]
----------------
ashgti wrote:

I have updated this to not pass in the port, but instead read the port that was 
picked by `lldb-dap` when its picked.

Instead now you pass a `--connection` to `lldb-dap` and it will print the 
listeners its created for the connection like:

```
$ lldb-dap --connection tcp://localhost:0
Listening for: tcp://localhost:51282, tcp://localhost:51283
^C
$ lldb-dap --connection unix:///tmp/abc321
Listening for: unix:///tmp/abc321
``` 

The tests now read the port from stdout.

https://github.com/llvm/llvm-project/pull/116392
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to