ovyalov created this revision.
ovyalov added reviewers: tberghammer, labath.
ovyalov added a subscriber: lldb-commits.
Herald added subscribers: danalbert, tberghammer.

We can connect to a device using various protocols (tcp, unix domain, abstract).
Instead of adding new URL schemes (e.g., adb-unix, adb-abstract) to cover 
alternative transport we can use standard connect URLs together with device id 
as hostname, unless it matches "localhost".
If hostname is "localhost" then we expect a single connected device.

http://reviews.llvm.org/D14101

Files:
  source/Plugins/Platform/Android/PlatformAndroid.cpp
  source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp

Index: source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
===================================================================
--- source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
+++ source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
@@ -126,7 +126,7 @@
         return Error("URL is null.");
     if (!UriParser::Parse (url, scheme, host, remote_port, path))
         return Error("Invalid URL: %s", url);
-    if (scheme == "adb")
+    if (host != "localhost")
         m_device_id = host;
 
     std::string connect_url;
Index: source/Plugins/Platform/Android/PlatformAndroid.cpp
===================================================================
--- source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ source/Plugins/Platform/Android/PlatformAndroid.cpp
@@ -196,7 +196,7 @@
         return Error("URL is null.");
     if (!UriParser::Parse(url, scheme, host, port, path))
         return Error("Invalid URL: %s", url);
-    if (scheme == "adb")
+    if (host != "localhost")
         m_device_id = host;
 
     auto error = PlatformLinux::ConnectRemote(args);


Index: source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
===================================================================
--- source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
+++ source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
@@ -126,7 +126,7 @@
         return Error("URL is null.");
     if (!UriParser::Parse (url, scheme, host, remote_port, path))
         return Error("Invalid URL: %s", url);
-    if (scheme == "adb")
+    if (host != "localhost")
         m_device_id = host;
 
     std::string connect_url;
Index: source/Plugins/Platform/Android/PlatformAndroid.cpp
===================================================================
--- source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ source/Plugins/Platform/Android/PlatformAndroid.cpp
@@ -196,7 +196,7 @@
         return Error("URL is null.");
     if (!UriParser::Parse(url, scheme, host, port, path))
         return Error("Invalid URL: %s", url);
-    if (scheme == "adb")
+    if (host != "localhost")
         m_device_id = host;
 
     auto error = PlatformLinux::ConnectRemote(args);
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to