From 1e209fcceba66b84208148e6773ae30593df0df8 Mon Sep 17 00:00:00 2001 From: Tamas Berghammer Date: Fri, 13 Mar 2015 11:36:47 +0000 Subject: Create NativeRegisterContext for android-arm64 Differential revision: http://reviews.llvm.org/D8058 llvm-svn: 232160 --- .../Plugins/Process/Linux/NativeProcessLinux.cpp | 40 +++++++++------------- 1 file changed, 17 insertions(+), 23 deletions(-) (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp') diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index 7c9b32beda61..34f38621e57c 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -18,11 +18,6 @@ #include #include -#if defined (__arm64__) || defined (__aarch64__) -// NT_PRSTATUS and NT_FPREGSET definition -#include -#endif - // C++ Includes #include #include @@ -35,6 +30,7 @@ #include "lldb/Core/RegisterValue.h" #include "lldb/Core/Scalar.h" #include "lldb/Core/State.h" +#include "lldb/Host/common/NativeBreakpoint.h" #include "lldb/Host/common/NativeRegisterContext.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" @@ -45,21 +41,17 @@ #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Utility/PseudoTerminal.h" -#include "lldb/Host/common/NativeBreakpoint.h" -#include "Utility/StringExtractor.h" - +#include "Plugins/Process/POSIX/ProcessPOSIXLog.h" #include "Plugins/Process/Utility/LinuxSignals.h" +#include "Utility/StringExtractor.h" #include "NativeThreadLinux.h" #include "ProcFileReader.h" +#include "Procfs.h" #include "ThreadStateCoordinator.h" -#include "Plugins/Process/POSIX/ProcessPOSIXLog.h" // System includes - They have to be included after framework includes because they define some // macros which collide with variable names in other modules #include -#ifndef __ANDROID__ -#include -#endif #include #include #include @@ -69,6 +61,11 @@ #include #include +#if defined (__arm64__) || defined (__aarch64__) +// NT_PRSTATUS and NT_FPREGSET definition +#include +#endif + #ifdef __ANDROID__ #define __ptrace_request int #define PT_DETACH PTRACE_DETACH @@ -445,7 +442,7 @@ namespace (log->GetMask().Test(POSIX_LOG_MEMORY_DATA_SHORT) && size <= POSIX_LOG_MEMORY_SHORT_BYTES))) log->Printf ("NativeProcessLinux::%s() [%p]:0x%lx (0x%lx)", __FUNCTION__, - (void*)vm_addr, *(unsigned long*)src, data); + (void*)vm_addr, *(const unsigned long*)src, data); if (PTRACE(PTRACE_POKEDATA, pid, (void*)vm_addr, (void*)data, 0, error)) { @@ -480,7 +477,7 @@ namespace (log->GetMask().Test(POSIX_LOG_MEMORY_DATA_SHORT) && size <= POSIX_LOG_MEMORY_SHORT_BYTES))) log->Printf ("NativeProcessLinux::%s() [%p]:0x%lx (0x%lx)", __FUNCTION__, - (void*)vm_addr, *(unsigned long*)src, *(unsigned long*)buff); + (void*)vm_addr, *(const unsigned long*)src, *(unsigned long*)buff); } vm_addr += word_size; @@ -807,10 +804,7 @@ namespace ioVec.iov_base = m_buf; ioVec.iov_len = m_buf_size; - if (PTRACE(PTRACE_GETREGSET, m_tid, ®set, &ioVec, m_buf_size) < 0) - m_result = false; - else - m_result = true; + PTRACE(PTRACE_GETREGSET, m_tid, ®set, &ioVec, m_buf_size, m_error); #else PTRACE(PTRACE_GETFPREGS, m_tid, nullptr, m_buf, m_buf_size, m_error); #endif @@ -1933,10 +1927,10 @@ static int convert_pid_status_to_return_code (int status) // Main process monitoring waitpid-loop handler. bool NativeProcessLinux::MonitorCallback(void *callback_baton, - lldb::pid_t pid, - bool exited, - int signal, - int status) + lldb::pid_t pid, + bool exited, + int signal, + int status) { Log *log (GetLogIfAnyCategoriesSet (LIBLLDB_LOG_PROCESS)); @@ -3429,7 +3423,7 @@ NativeProcessLinux::WriteMemory (lldb::addr_t addr, const void *buf, lldb::addr_ Error NativeProcessLinux::ReadRegisterValue(lldb::tid_t tid, uint32_t offset, const char* reg_name, - uint32_t size, RegisterValue &value) + uint32_t size, RegisterValue &value) { ReadRegOperation op(tid, offset, reg_name, value); DoOperation(&op); -- cgit v1.2.3