This is an archive of the discontinued LLVM Phabricator instance.

Support remote-android with multiple connected devices.
ClosedPublic

Authored by chaoren on Apr 29 2015, 4:46 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

chaoren updated this revision to Diff 24667.Apr 29 2015, 4:46 PM
chaoren retitled this revision from to Support remote-android with multiple connected devices..
chaoren updated this object.
chaoren edited the test plan for this revision. (Show Details)
chaoren added reviewers: vharron, tberghammer, ovyalov.
chaoren added a subscriber: Unknown Object (MLST).
ovyalov requested changes to this revision.Apr 29 2015, 11:34 PM
ovyalov edited edge metadata.

Please see my comments.

source/Plugins/Platform/Android/PlatformAndroid.cpp
189 ↗(On Diff #24667)

Please check url is not null.

191 ↗(On Diff #24667)

Could you add URL to error message?

193 ↗(On Diff #24667)

m_device_id is already cleared at line 177.

200 ↗(On Diff #24667)

Please remove this comment if it's no longer relevant.

source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
95 ↗(On Diff #24667)

Add "adb" constant?

98 ↗(On Diff #24667)

Could you make such args transformation within PlatformAndroid::ConnectRemote to make PlatformLinux::ConnectRemote accept only "connect://" protocol?

98 ↗(On Diff #24667)

Could you just update first args item in order to preserve all other args values?

This revision now requires changes to proceed.Apr 29 2015, 11:34 PM
chaoren added inline comments.Apr 30 2015, 12:08 PM
source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
95 ↗(On Diff #24667)

If I make the change in your comment below, this would only appear in PlatformAndroid::ConnectRemote, would it still be necessary?

98 ↗(On Diff #24667)

Could you make such args transformation within PlatformAndroid::ConnectRemote to make PlatformLinux::ConnectRemote accept only "connect://" protocol?

But then PlatformAndroidRemoteGDBServer::ConnectRemote won't be able to see the adb scheme.

Or are we forgoing the connect scheme for Android altogether? There won't be a way to "just connect to that one device."

ovyalov added inline comments.Apr 30 2015, 1:17 PM
source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
98 ↗(On Diff #24667)

As an alternative we may use "connect://localhost:port" scheme for a single connected device or "connect://localhost:port/device-id" in order to connect to a particular connected device.

chaoren added inline comments.Apr 30 2015, 2:37 PM
source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
98 ↗(On Diff #24667)

:/ I know we're probably going to be the only people using this, but it just doesn't feel right to abuse the URI scheme like this.

Perhaps it would be more correct if we added a case in ConnectionFileDescriptor::Connect to treat adb://device-id:port as connect://localhost:port? Then it wouldn't even be necessary to rewrite the args.

chaoren updated this revision to Diff 24785.Apr 30 2015, 6:04 PM
chaoren edited edge metadata.

Update as per discussion.

chaoren updated this revision to Diff 24786.Apr 30 2015, 6:06 PM
chaoren edited edge metadata.

Accidentally included the other CL.

ovyalov accepted this revision.Apr 30 2015, 10:10 PM
ovyalov edited edge metadata.

lgtm

This revision is now accepted and ready to land.Apr 30 2015, 10:10 PM
This revision was automatically updated to reflect the committed changes.
clayborg edited edge metadata.May 1 2015, 11:11 AM

Looks good.