Support unix-abstract-connect scheme as platform url in lldb testsuite

Reviewers: ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D14765

llvm-svn: 253488
This commit is contained in:
Ying Chen 2015-11-18 19:03:20 +00:00
parent 48ef8d4c37
commit ca922bb9b9
2 changed files with 11 additions and 4 deletions

View File

@ -461,8 +461,11 @@ def android_device_api():
assert lldb.platform_url is not None
device_id = None
parsed_url = urlparse.urlparse(lldb.platform_url)
if parsed_url.scheme == "adb":
device_id = parsed_url.netloc.split(":")[0]
host_name = parsed_url.netloc.split(":")[0]
if host_name != 'localhost':
device_id = host_name
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:

View File

@ -61,8 +61,12 @@ class GdbRemoteTestCaseBase(TestBase):
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-'):
url_pattern = '(.+)://\[?(.+?)\]?/.*'
else:
url_pattern = '(.+)://(.+):\d+'
scheme, host = re.match(url_pattern, lldb.platform_url).groups()
if lldb.remote_platform_name == 'remote-android' and host != 'localhost':
self.stub_device = host
self.stub_hostname = 'localhost'
else: