From 720cd3f6890e48efaa9fe00596170ff82209f7e9 Mon Sep 17 00:00:00 2001 From: Todd Fiala Date: Mon, 16 Jun 2014 14:49:28 +0000 Subject: [PATCH] Move x86-specific struct user code for Linux ProcessMonitor behind #define guards. See http://reviews.llvm.org/D4092 for details. Change by Paul Osmialowski. (Minor tweaks to the comment by Todd.) llvm-svn: 211026 --- lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp index d3ecc69..1ff0782f 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp @@ -744,6 +744,9 @@ ReadThreadPointerOperation::Execute(ProcessMonitor *monitor) const ArchSpec& arch = monitor->GetProcess().GetTarget().GetArchitecture(); switch(arch.GetMachine()) { +#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. case llvm::Triple::x86: { // Find the GS register location for our host architecture. @@ -770,6 +773,7 @@ ReadThreadPointerOperation::Execute(ProcessMonitor *monitor) *m_addr = tmp[1]; break; } +#endif case llvm::Triple::x86_64: // Read the FS register base. m_result = (PTRACE(PTRACE_ARCH_PRCTL, m_tid, m_addr, (void *)ARCH_GET_FS, 0) == 0); -- 2.7.4