summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/cmake/platforms/Android.cmake11
-rw-r--r--lldb/include/lldb/Host/Time.h26
-rw-r--r--lldb/include/lldb/Host/android/Android.h3
-rw-r--r--lldb/include/lldb/Host/linux/Personality.h25
-rw-r--r--lldb/include/lldb/Host/linux/Ptrace.h66
-rw-r--r--lldb/include/lldb/Host/linux/Signalfd.h54
-rw-r--r--lldb/include/lldb/Host/posix/Fcntl.h25
-rw-r--r--lldb/source/DataFormatters/CXXFormatterFunctions.cpp3
-rw-r--r--lldb/source/Host/CMakeLists.txt1
-rw-r--r--lldb/source/Host/android/LibcGlue.cpp39
-rw-r--r--lldb/source/Host/posix/HostInfoPosix.cpp26
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp54
-rw-r--r--lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp37
-rw-r--r--lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp2
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp15
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp6
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp2
-rw-r--r--lldb/source/Utility/PseudoTerminal.cpp1
18 files changed, 309 insertions, 87 deletions
diff --git a/lldb/cmake/platforms/Android.cmake b/lldb/cmake/platforms/Android.cmake
index 725895a5d2e..2af8de70562 100644
--- a/lldb/cmake/platforms/Android.cmake
+++ b/lldb/cmake/platforms/Android.cmake
@@ -85,12 +85,21 @@ if( NOT CMAKE_C_COMPILER )
set( CMAKE_RANLIB "${ANDROID_TOOLCHAIN_DIR}/bin/${ANDROID_TOOLCHAIN_NAME}-ranlib${EXECUTABLE_SUFFIX}" CACHE PATH "ranlib" )
endif()
-set( ANDROID_CXX_FLAGS "--sysroot=${ANDROID_SYSROOT} -pie -fPIE -funwind-tables -fsigned-char -no-canonical-prefixes" )
+set( ANDROID_CXX_FLAGS "--sysroot=${ANDROID_SYSROOT} -funwind-tables -fsigned-char -no-canonical-prefixes" )
# TODO: different ARM abi have different flags such as neon, vfpv etc
if( X86 )
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300" )
+elseif( ANDROID_ABI STREQUAL "armeabi" )
+ # 64 bit atomic operations used in c++ libraries require armv7-a instructions
+ # armv5te and armv6 were tried but do not work.
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv7-a" )
endif()
+# PIE is required for API 21+ so we enable it
+# unfortunately, it is not supported before API 14 so we need to do something else there
+# see http://llvm.org/pr23457
+set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -pie -fPIE" )
+
# linker flags
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fdata-sections -ffunction-sections" )
set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--gc-sections" )
diff --git a/lldb/include/lldb/Host/Time.h b/lldb/include/lldb/Host/Time.h
new file mode 100644
index 00000000000..1da144975b5
--- /dev/null
+++ b/lldb/include/lldb/Host/Time.h
@@ -0,0 +1,26 @@
+//===-- Time.h --------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// Include system time headers, adding missing functions as necessary
+
+#ifndef liblldb_Host_Time_h_
+#define liblldb_Host_Time_h_
+
+#ifdef __ANDROID_NDK__
+#include <android/api-level.h>
+#endif
+
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
+#include <time64.h>
+static time_t timegm(struct tm* t);
+#else
+#include <time.h>
+#endif
+
+#endif // liblldb_Host_Time_h_
diff --git a/lldb/include/lldb/Host/android/Android.h b/lldb/include/lldb/Host/android/Android.h
index df2f7352572..8efc1a53b01 100644
--- a/lldb/include/lldb/Host/android/Android.h
+++ b/lldb/include/lldb/Host/android/Android.h
@@ -16,9 +16,6 @@
#define _isatty isatty
#define SYS_tgkill __NR_tgkill
-#define PT_DETACH PTRACE_DETACH
-
-typedef int __ptrace_request;
namespace std
{
diff --git a/lldb/include/lldb/Host/linux/Personality.h b/lldb/include/lldb/Host/linux/Personality.h
new file mode 100644
index 00000000000..48fc2e2bdd4
--- /dev/null
+++ b/lldb/include/lldb/Host/linux/Personality.h
@@ -0,0 +1,25 @@
+//===-- Personality.h -------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// This file defines personality functions & structures
+
+#ifndef liblldb_Host_linux_Personality_h_
+#define liblldb_Host_linux_Personality_h_
+
+#ifdef __ANDROID_NDK__
+#include <android/api-level.h>
+#endif
+
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
+#include <linux/personality.h>
+#else
+#include <sys/personality.h>
+#endif
+
+#endif // liblldb_Host_linux_Personality_h_
diff --git a/lldb/include/lldb/Host/linux/Ptrace.h b/lldb/include/lldb/Host/linux/Ptrace.h
new file mode 100644
index 00000000000..b28bb37715d
--- /dev/null
+++ b/lldb/include/lldb/Host/linux/Ptrace.h
@@ -0,0 +1,66 @@
+//===-- Ptrace.h ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// This file defines ptrace functions & structures
+
+#ifndef liblldb_Host_linux_Ptrace_h_
+#define liblldb_Host_linux_Ptrace_h_
+
+#include <sys/ptrace.h>
+
+#ifdef __ANDROID_NDK__
+#define PT_DETACH PTRACE_DETACH
+typedef int __ptrace_request;
+#endif
+
+#define DEBUG_PTRACE_MAXBYTES 20
+
+// Support ptrace extensions even when compiled without required kernel support
+#ifndef PT_GETREGS
+ #ifndef PTRACE_GETREGS
+ #define PTRACE_GETREGS 12
+ #endif
+#endif
+#ifndef PT_SETREGS
+ #ifndef PTRACE_SETREGS
+ #define PTRACE_SETREGS 13
+ #endif
+#endif
+#ifndef PT_GETFPREGS
+ #ifndef PTRACE_GETFPREGS
+ #define PTRACE_GETFPREGS 14
+ #endif
+#endif
+#ifndef PT_SETFPREGS
+ #ifndef PTRACE_SETFPREGS
+ #define PTRACE_SETFPREGS 15
+ #endif
+#endif
+#ifndef PTRACE_GETREGSET
+ #define PTRACE_GETREGSET 0x4204
+#endif
+#ifndef PTRACE_SETREGSET
+ #define PTRACE_SETREGSET 0x4205
+#endif
+#ifndef PTRACE_GET_THREAD_AREA
+ #define PTRACE_GET_THREAD_AREA 25
+#endif
+#ifndef PTRACE_ARCH_PRCTL
+ #define PTRACE_ARCH_PRCTL 30
+#endif
+#ifndef ARCH_GET_FS
+ #define ARCH_SET_GS 0x1001
+ #define ARCH_SET_FS 0x1002
+ #define ARCH_GET_FS 0x1003
+ #define ARCH_GET_GS 0x1004
+#endif
+
+#define LLDB_PTRACE_NT_ARM_TLS 0x401 // ARM TLS register
+
+#endif // liblldb_Host_linux_Ptrace_h_
diff --git a/lldb/include/lldb/Host/linux/Signalfd.h b/lldb/include/lldb/Host/linux/Signalfd.h
new file mode 100644
index 00000000000..cf50e87097f
--- /dev/null
+++ b/lldb/include/lldb/Host/linux/Signalfd.h
@@ -0,0 +1,54 @@
+//===-- Signalfd.h ----------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// This file defines signalfd functions & structures
+
+#ifndef liblldb_Host_linux_Signalfd_h_
+#define liblldb_Host_linux_Signalfd_h_
+
+#ifdef __ANDROID_NDK__
+#include <android/api-level.h>
+#endif
+
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
+
+#include <linux/types.h>
+#include <linux/fcntl.h>
+
+#define SFD_CLOEXEC O_CLOEXEC
+#define SFD_NONBLOCK O_NONBLOCK
+
+struct signalfd_siginfo {
+ __u32 ssi_signo;
+ __s32 ssi_errno;
+ __s32 ssi_code;
+ __u32 ssi_pid;
+ __u32 ssi_uid;
+ __s32 ssi_fd;
+ __u32 ssi_tid;
+ __u32 ssi_band;
+ __u32 ssi_overrun;
+ __u32 ssi_trapno;
+ __s32 ssi_status;
+ __s32 ssi_int;
+ __u64 ssi_ptr;
+ __u64 ssi_utime;
+ __u64 ssi_stime;
+ __u64 ssi_addr;
+ __u16 ssi_addr_lsb;
+ __u8 __pad[46];
+};
+
+int signalfd (int fd, const sigset_t *mask, int flags);
+
+#else
+#include <sys/signalfd.h>
+#endif
+
+#endif // liblldb_Host_linux_Signalfd_h_
diff --git a/lldb/include/lldb/Host/posix/Fcntl.h b/lldb/include/lldb/Host/posix/Fcntl.h
new file mode 100644
index 00000000000..3e3a472f0a2
--- /dev/null
+++ b/lldb/include/lldb/Host/posix/Fcntl.h
@@ -0,0 +1,25 @@
+//===-- Fcntl.h -------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// This file defines fcntl functions & structures
+
+#ifndef liblldb_Host_posix_Fcntl_h_
+#define liblldb_Host_posix_Fcntl_h_
+
+#ifdef __ANDROID_NDK__
+#include <android/api-level.h>
+#endif
+
+#include <fcntl.h>
+
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
+#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
+#endif
+
+#endif // liblldb_Host_posix_Fcntl_h_
diff --git a/lldb/source/DataFormatters/CXXFormatterFunctions.cpp b/lldb/source/DataFormatters/CXXFormatterFunctions.cpp
index 9c45e272a63..de62139852d 100644
--- a/lldb/source/DataFormatters/CXXFormatterFunctions.cpp
+++ b/lldb/source/DataFormatters/CXXFormatterFunctions.cpp
@@ -29,10 +29,13 @@
#include "lldb/Utility/ProcessStructReader.h"
#include <algorithm>
+
#if __ANDROID_NDK__
#include <sys/types.h>
#endif
+#include "lldb/Host/Time.h"
+
using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::formatters;
diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt
index 5f5547764dc..a13defa46c5 100644
--- a/lldb/source/Host/CMakeLists.txt
+++ b/lldb/source/Host/CMakeLists.txt
@@ -104,6 +104,7 @@ else()
if (__ANDROID_NDK__)
add_host_subdirectory(android
android/HostInfoAndroid.cpp
+ android/LibcGlue.cpp
android/ProcessLauncherAndroid.cpp
linux/Host.cpp
linux/HostInfoLinux.cpp
diff --git a/lldb/source/Host/android/LibcGlue.cpp b/lldb/source/Host/android/LibcGlue.cpp
new file mode 100644
index 00000000000..d443a92724e
--- /dev/null
+++ b/lldb/source/Host/android/LibcGlue.cpp
@@ -0,0 +1,39 @@
+//===-- LibcGlue.cpp --------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// This files adds functions missing from libc on earlier versions of Android
+
+#include <android/api-level.h>
+
+#if __ANDROID_API__ < 21
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/syscall.h>
+#include <signal.h>
+
+#include "lldb/Host/Time.h"
+
+time_t timegm(struct tm* t)
+{
+ return (time_t) timegm64(t);
+}
+
+int signalfd (int fd, const sigset_t *mask, int flags)
+{
+ return syscall(__NR_signalfd4, fd, mask, _NSIG / 8, flags);
+}
+
+int posix_openpt(int flags)
+{
+ return open("/dev/ptmx", flags);
+}
+
+#endif
diff --git a/lldb/source/Host/posix/HostInfoPosix.cpp b/lldb/source/Host/posix/HostInfoPosix.cpp
index debff52d8c1..160bd235565 100644
--- a/lldb/source/Host/posix/HostInfoPosix.cpp
+++ b/lldb/source/Host/posix/HostInfoPosix.cpp
@@ -17,6 +17,7 @@
#include <grp.h>
#include <limits.h>
+#include <mutex>
#include <netdb.h>
#include <pwd.h>
#include <sys/types.h>
@@ -47,9 +48,31 @@ HostInfoPosix::GetHostname(std::string &s)
return false;
}
+#ifdef __ANDROID_NDK__
+#include <android/api-level.h>
+#endif
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
+#define USE_GETPWUID
+#endif
+
+#ifdef USE_GETPWUID
+static std::mutex s_getpwuid_lock;
+#endif
+
const char *
HostInfoPosix::LookupUserName(uint32_t uid, std::string &user_name)
{
+#ifdef USE_GETPWUID
+ // getpwuid_r is missing from android-9
+ // make getpwuid thread safe with a mutex
+ std::lock_guard<std::mutex> lock(s_getpwuid_lock);
+ struct passwd *user_info_ptr = ::getpwuid(uid);
+ if (user_info_ptr)
+ {
+ user_name.assign(user_info_ptr->pw_name);
+ return user_name.c_str();
+ }
+#else
struct passwd user_info;
struct passwd *user_info_ptr = &user_info;
char user_buffer[PATH_MAX];
@@ -62,8 +85,9 @@ HostInfoPosix::LookupUserName(uint32_t uid, std::string &user_name)
return user_name.c_str();
}
}
+#endif
user_name.clear();
- return NULL;
+ return nullptr;
}
const char *
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 4e4bbd8eb29..5491efec43c 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -54,10 +54,8 @@
// System includes - They have to be included after framework includes because they define some
// macros which collide with variable names in other modules
#include <linux/unistd.h>
-#include <sys/personality.h>
-#include <sys/ptrace.h>
#include <sys/socket.h>
-#include <sys/signalfd.h>
+
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/user.h>
@@ -68,52 +66,10 @@
#include <elf.h>
#endif
-#ifdef __ANDROID__
-#define __ptrace_request int
-#define PT_DETACH PTRACE_DETACH
-#endif
-
-#define DEBUG_PTRACE_MAXBYTES 20
-
-// Support ptrace extensions even when compiled without required kernel support
-#ifndef PT_GETREGS
-#ifndef PTRACE_GETREGS
- #define PTRACE_GETREGS 12
-#endif
-#endif
-#ifndef PT_SETREGS
-#ifndef PTRACE_SETREGS
- #define PTRACE_SETREGS 13
-#endif
-#endif
-#ifndef PT_GETFPREGS
-#ifndef PTRACE_GETFPREGS
- #define PTRACE_GETFPREGS 14
-#endif
-#endif
-#ifndef PT_SETFPREGS
-#ifndef PTRACE_SETFPREGS
- #define PTRACE_SETFPREGS 15
-#endif
-#endif
-#ifndef PTRACE_GETREGSET
- #define PTRACE_GETREGSET 0x4204
-#endif
-#ifndef PTRACE_SETREGSET
- #define PTRACE_SETREGSET 0x4205
-#endif
-#ifndef PTRACE_GET_THREAD_AREA
- #define PTRACE_GET_THREAD_AREA 25
-#endif
-#ifndef PTRACE_ARCH_PRCTL
- #define PTRACE_ARCH_PRCTL 30
-#endif
-#ifndef ARCH_GET_FS
- #define ARCH_SET_GS 0x1001
- #define ARCH_SET_FS 0x1002
- #define ARCH_GET_FS 0x1003
- #define ARCH_GET_GS 0x1004
-#endif
+#include "lldb/Host/linux/Personality.h"
+#include "lldb/Host/linux/Ptrace.h"
+#include "lldb/Host/linux/Signalfd.h"
+#include "lldb/Host/android/Android.h"
#define LLDB_PERSONALITY_GET_CURRENT_SETTINGS 0xffffffff
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
index 4b29a09ccfc..b8f2a3f0d8b 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -41,8 +41,12 @@
// System includes - They have to be included after framework includes because they define some
// macros which collide with variable names in other modules
-#include <sys/personality.h>
-#include <sys/ptrace.h>
+
+#include "lldb/Host/linux/Personality.h"
+#include "lldb/Host/linux/Ptrace.h"
+#include "lldb/Host/linux/Signalfd.h"
+#include "lldb/Host/android/Android.h"
+
#include <sys/socket.h>
#include <sys/syscall.h>
#include <sys/types.h>
@@ -50,37 +54,8 @@
#include <sys/user.h>
#include <sys/wait.h>
-#ifdef __ANDROID__
-#define __ptrace_request int
-#define PT_DETACH PTRACE_DETACH
-#endif
-
-#define DEBUG_PTRACE_MAXBYTES 20
-
-// Support ptrace extensions even when compiled without required kernel support
-#ifndef PTRACE_GETREGSET
- #define PTRACE_GETREGSET 0x4204
-#endif
-#ifndef PTRACE_SETREGSET
- #define PTRACE_SETREGSET 0x4205
-#endif
-#ifndef PTRACE_GET_THREAD_AREA
- #define PTRACE_GET_THREAD_AREA 25
-#endif
-#ifndef PTRACE_ARCH_PRCTL
- #define PTRACE_ARCH_PRCTL 30
-#endif
-#ifndef ARCH_GET_FS
- #define ARCH_SET_GS 0x1001
- #define ARCH_SET_FS 0x1002
- #define ARCH_GET_FS 0x1003
- #define ARCH_GET_GS 0x1004
-#endif
-
#define LLDB_PERSONALITY_GET_CURRENT_SETTINGS 0xffffffff
-#define LLDB_PTRACE_NT_ARM_TLS 0x401 // ARM TLS register
-
// Support hardware breakpoints in case it has not been defined
#ifndef TRAP_HWBKPT
#define TRAP_HWBKPT 4
diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
index 798818b7d11..09f72cbde97 100644
--- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
+++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
@@ -33,6 +33,8 @@
#include "Plugins/Process/Linux/ProcessMonitor.h"
#include "POSIXThread.h"
+#include "lldb/Host/posix/Fcntl.h"
+
using namespace lldb;
using namespace lldb_private;
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 064b60a238a..89d98760a60 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -259,7 +259,7 @@ GDBRemoteCommunication::SendPacketNoLock (const char *payload, size_t payload_le
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 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname,
// 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 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname,
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 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname,
{
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 e8b39eaeb5d..0cc528fb565 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -396,6 +396,10 @@ GDBRemoteCommunication::PacketResult
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 @@ GDBRemoteCommunicationServerCommon::Handle_qUserName (StringExtractorGDBRemote &
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 0ab965853a5..36d64857046 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
@@ -117,7 +117,7 @@ GDBRemoteCommunicationServerPlatform::Handle_qLaunchGDBServer (StringExtractorGD
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.
diff --git a/lldb/source/Utility/PseudoTerminal.cpp b/lldb/source/Utility/PseudoTerminal.cpp
index 302c265783a..bc3cfee226f 100644
--- a/lldb/source/Utility/PseudoTerminal.cpp
+++ b/lldb/source/Utility/PseudoTerminal.cpp
@@ -34,6 +34,7 @@ pid_t fork(void) { return 0; }
pid_t setsid(void) { return 0; }
#elif defined(__ANDROID_NDK__)
#include "lldb/Host/android/Android.h"
+int posix_openpt(int flags);
#endif
using namespace lldb_utility;
OpenPOWER on IntegriCloud