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
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 @@
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 @@
*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);