[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:20:05 PDT 2024
================
@@ -0,0 +1,202 @@
+"""
+Test lldb-dap "port" configuration to "attach" request
+"""
+
+
+import dap_server
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+from lldbsuite.test import lldbplatformutil
+import lldbdap_testcase
+import os
+import shutil
+import subprocess
+import tempfile
+import threading
+import sys
+import socket
+import select
+
+
+# A class representing a pipe for communicating with debug server.
+# This class includes menthods to open the pipe and read the port number from it.
+class Pipe(object):
+ def __init__(self, prefix):
+ self.name = os.path.join(prefix, "stub_port_number")
+ os.mkfifo(self.name)
+ self._fd = os.open(self.name, os.O_RDONLY | os.O_NONBLOCK)
+
+ def finish_connection(self, timeout):
+ pass
+
+ def read(self, size, timeout):
+ (readers, _, _) = select.select([self._fd], [], [], timeout)
+ if self._fd not in readers:
+ raise TimeoutError
+ return os.read(self._fd, size)
+
+ def close(self):
+ os.close(self._fd)
----------------
labath wrote:
Thanks. Glad we got that resolved.
https://github.com/llvm/llvm-project/pull/91570
More information about the lldb-commits
mailing list