Add Linux support for get thread area on ARM64 using ProcessMonitor debugging.

See http://reviews.llvm.org/D5073.

Change by Paul Osmialowski.

llvm-svn: 216553
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
index 048a517..416d6a6 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -15,6 +15,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <unistd.h>
+#include <elf.h>
 #include <sys/personality.h>
 #include <sys/ptrace.h>
 #include <sys/uio.h>
@@ -24,11 +25,6 @@
 #include <sys/user.h>
 #include <sys/wait.h>
 
-#if defined (__arm64__) || defined (__aarch64__)
-// NT_PRSTATUS and NT_FPREGSET definition
-#include <elf.h>
-#endif
-
 // C++ Includes
 // Other libraries and framework includes
 #include "lldb/Core/Debugger.h"
@@ -802,6 +798,19 @@
     const ArchSpec& arch = monitor->GetProcess().GetTarget().GetArchitecture();
     switch(arch.GetMachine())
     {
+    case llvm::Triple::aarch64:
+    {
+         int regset = NT_ARM_TLS;
+         struct iovec ioVec;
+
+         ioVec.iov_base = m_addr;
+         ioVec.iov_len = sizeof(lldb::addr_t);
+         if (PTRACE(PTRACE_GETREGSET, m_tid, &regset, &ioVec, ioVec.iov_len) < 0)
+           m_result = false;
+         else
+           m_result = true;
+         break;
+    }
 #if defined(__i386__) || defined(__x86_64__)
     // Note that struct user below has a field named i387 which is x86-specific.
     // Therefore, this case should be compiled only for x86-based systems.