chying created this revision. chying added a reviewer: ovyalov. chying added a subscriber: lldb-commits.
http://reviews.llvm.org/D14765 Files: packages/Python/lldbsuite/test/lldbtest.py packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py Index: packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py =================================================================== --- packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py +++ packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py @@ -61,8 +61,12 @@ self.named_pipe_fd = None self.stub_sends_two_stop_notifications_on_kill = False if lldb.platform_url: - scheme, host = re.match('(.+)://(.+):\d+', lldb.platform_url).groups() - if scheme == 'adb': + if lldb.platform_url.startswith('unix-abstract-connect'): + url_pattern = '(.+)://\[?(.+?)\]?/.*' + else: + url_pattern = '(.+)://(.+):\d+' + scheme, host = re.match(url_pattern, lldb.platform_url).groups() + if scheme in ['adb', 'unix-abstract-connect']: self.stub_device = host self.stub_hostname = 'localhost' else: Index: packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -461,8 +461,10 @@ assert lldb.platform_url is not None device_id = None parsed_url = urlparse.urlparse(lldb.platform_url) - if parsed_url.scheme == "adb": + if parsed_url.scheme in ["adb", "unix-abstract-connect"]: device_id = parsed_url.netloc.split(":")[0] + if device_id.startswith('[') and device_id.endswith(']'): + device_id = device_id[1:-1] retcode, stdout, stderr = run_adb_command( ["shell", "getprop", "ro.build.version.sdk"], device_id) if retcode == 0:
Index: packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py =================================================================== --- packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py +++ packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py @@ -61,8 +61,12 @@ self.named_pipe_fd = None self.stub_sends_two_stop_notifications_on_kill = False if lldb.platform_url: - scheme, host = re.match('(.+)://(.+):\d+', lldb.platform_url).groups() - if scheme == 'adb': + if lldb.platform_url.startswith('unix-abstract-connect'): + url_pattern = '(.+)://\[?(.+?)\]?/.*' + else: + url_pattern = '(.+)://(.+):\d+' + scheme, host = re.match(url_pattern, lldb.platform_url).groups() + if scheme in ['adb', 'unix-abstract-connect']: self.stub_device = host self.stub_hostname = 'localhost' else: Index: packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -461,8 +461,10 @@ assert lldb.platform_url is not None device_id = None parsed_url = urlparse.urlparse(lldb.platform_url) - if parsed_url.scheme == "adb": + if parsed_url.scheme in ["adb", "unix-abstract-connect"]: device_id = parsed_url.netloc.split(":")[0] + if device_id.startswith('[') and device_id.endswith(']'): + device_id = device_id[1:-1] retcode, stdout, stderr = run_adb_command( ["shell", "getprop", "ro.build.version.sdk"], device_id) if retcode == 0:
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits