Merge upstream llvm.org r217843 into dev-llgs-local-launch
If a new platform is created/selected for an architecture, make it the selected platform so you can do things like:
% lldb ios-executable
(lldb) platform connect connect://localhost:11111

Prior to this fix, the host platform would be selected even though the target was using the ios-remote platform.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@217963 91177308-0d34-0410-b5e6-96231b3b80d8
Retry remote connection one time in case of timeout and return an error that specifies why debugging failed.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@217998 91177308-0d34-0410-b5e6-96231b3b80d8
Listen to the return value of the Platform::WriteFile() call within PlatformPOSIX::PutFile() in case we write less than we wanted to. Also adjust the input stream's offset in such cases.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@217999 91177308-0d34-0410-b5e6-96231b3b80d8
Add better logging for the "$vFile:pwrite:" packet so we can show binary data instead of nothing or unprintable characters. This can easily be extended for other packets that have binary data.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218000 91177308-0d34-0410-b5e6-96231b3b80d8
Hex encode the triple values in case they contain special characters.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218001 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the ability of "lldb-platform" to upload files.

The issue was GDBRemoteCommunication::CheckForPacket() already fixes up any prefixed bytes (0x7d followed by value that is XOR'ed with 0x20). If we do this again, we cause binary packets to lose bytes.

This allows lldb-platform to be able to upload binaries and debug them remotely.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218002 91177308-0d34-0410-b5e6-96231b3b80d8
Merge remote-tracking branch 'origin/dev-llgs-local-launch' into dev-llgs-local-launch
Merge upstream llvm.org r218002 into dev-llgs-local-launch