Get lldb-server building on android-9

Build lldb-server with an android-9 sysroot.

llvm-svn: 237078
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 064b60a..89d9876 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -259,7 +259,7 @@
                 strm.Printf("<%4" PRIu64 "> send packet: %.*s", (uint64_t)bytes_written, (int)binary_start_offset, packet_data);
                 const uint8_t *p;
                 // Print binary data exactly as sent
-                for (p = (uint8_t*)packet_data + binary_start_offset; *p != '#'; ++p)
+                for (p = (const uint8_t*)packet_data + binary_start_offset; *p != '#'; ++p)
                     strm.Printf("\\x%2.2x", *p);
                 // Print the checksum
                 strm.Printf("%*s", (int)3, p);
@@ -822,7 +822,11 @@
             // connect to us..
             error = StartListenThread ("127.0.0.1", 0);
             if (error.Fail())
+            {
+                if (log)
+                    log->Printf ("GDBRemoteCommunication::%s() unable to start listen thread: %s", __FUNCTION__, error.AsCString());
                 return error;
+            }
 
             ConnectionFileDescriptor *connection = (ConnectionFileDescriptor *)GetConnection ();
             // Wait for 10 seconds to resolve the bound port
@@ -839,6 +843,8 @@
             else
             {
                 error.SetErrorString ("failed to bind to port 0 on 127.0.0.1");
+                if (log)
+                    log->Printf ("GDBRemoteCommunication::%s() failed: %s", __FUNCTION__, error.AsCString());
                 return error;
             }
         }
@@ -957,6 +963,13 @@
     {
         error.SetErrorStringWithFormat ("unable to locate " DEBUGSERVER_BASENAME );
     }
+
+    if (error.Fail())
+    {
+        if (log)
+            log->Printf ("GDBRemoteCommunication::%s() failed: %s", __FUNCTION__, error.AsCString());
+    }
+
     return error;
 }
 
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
index e8b39ea..0cc528f 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -396,6 +396,10 @@
 GDBRemoteCommunicationServerCommon::Handle_qUserName (StringExtractorGDBRemote &packet)
 {
 #if !defined(LLDB_DISABLE_POSIX)
+    Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
+    if (log)
+        log->Printf("GDBRemoteCommunicationServerCommon::%s begin", __FUNCTION__);
+
     // Packet format: "qUserName:%i" where %i is the uid
     packet.SetFilePos(::strlen ("qUserName:"));
     uint32_t uid = packet.GetU32 (UINT32_MAX);
@@ -409,6 +413,8 @@
             return SendPacketNoLock (response.GetData(), response.GetSize());
         }
     }
+    if (log)
+        log->Printf("GDBRemoteCommunicationServerCommon::%s end", __FUNCTION__);
 #endif
     return SendErrorResponse (5);
 
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
index 0ab9658..36d6485 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
@@ -117,7 +117,7 @@
     if (hostname.empty())
         hostname = "127.0.0.1";
     if (log)
-        log->Printf("Launching debugserver with: %s:%u...\n", hostname.c_str(), port);
+        log->Printf("Launching debugserver with: %s:%u...", hostname.c_str(), port);
 
     // Do not run in a new session so that it can not linger after the
     // platform closes.