This is an archive of the discontinued LLVM Phabricator instance.

Make remote-android platform to use dynamic local tcp ports when forwarding device ports.
ClosedPublic

Authored by ovyalov on Aug 31 2015, 5:12 PM.

Details

Summary

There is no guarantees that dynamically allocated device port will be free on host side - make remote-android platform to use dynamic local tcp ports when forwarding device ports.

Diff Detail

Event Timeline

ovyalov updated this revision to Diff 33653.Aug 31 2015, 5:12 PM
ovyalov retitled this revision from to Make remote-android platform to use dynamic local tcp ports when forwarding device ports..
ovyalov updated this object.
ovyalov added reviewers: labath, tberghammer.
labath accepted this revision.Sep 1 2015, 1:05 AM
labath edited edge metadata.

lgtm

source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
166

It might be good to add a comment explaining why is this code in a loop (= to retry, if someone manages to snatch the port from under us), as I don't think it will be obvious when someone finds this in the future.

This revision is now accepted and ready to land.Sep 1 2015, 1:05 AM
ovyalov updated this revision to Diff 33719.Sep 1 2015, 11:59 AM
ovyalov edited edge metadata.

Added the comment.

ovyalov closed this revision.Sep 1 2015, 12:05 PM

Files:

/lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp
/lldb/trunk/source/Plugins/Platform/Android/AdbClient.h
/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
/lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
/lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h

Users:

ovyalov (Author)

http://reviews.llvm.org/rL246574