lldb: deal with non-portable PTRACE-related constants
See http://reviews.llvm.org/D4091 for details.
Change by Paul Osmialowski.
llvm-svn: 211503
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
index 1ff0782f..457125a 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -122,18 +122,22 @@
verbose_log->Printf("PTRACE_POKEUSER %s", buf.GetData());
break;
}
+#ifdef PT_SETREGS
case PTRACE_SETREGS:
{
DisplayBytes(buf, data, data_size);
verbose_log->Printf("PTRACE_SETREGS %s", buf.GetData());
break;
}
+#endif
+#ifdef PT_SETFPREGS
case PTRACE_SETFPREGS:
{
DisplayBytes(buf, data, data_size);
verbose_log->Printf("PTRACE_SETFPREGS %s", buf.GetData());
break;
}
+#endif
case PTRACE_SETSIGINFO:
{
DisplayBytes(buf, data, sizeof(siginfo_t));
@@ -564,10 +568,14 @@
void
ReadGPROperation::Execute(ProcessMonitor *monitor)
{
+#ifdef PT_GETREGS
if (PTRACE(PTRACE_GETREGS, m_tid, NULL, m_buf, m_buf_size) < 0)
m_result = false;
else
m_result = true;
+#else
+ m_result = false;
+#endif
}
//------------------------------------------------------------------------------
@@ -592,10 +600,14 @@
void
ReadFPROperation::Execute(ProcessMonitor *monitor)
{
+#ifdef PT_GETFPREGS
if (PTRACE(PTRACE_GETFPREGS, m_tid, NULL, m_buf, m_buf_size) < 0)
m_result = false;
else
m_result = true;
+#else
+ m_result = false;
+#endif
}
//------------------------------------------------------------------------------
@@ -649,10 +661,14 @@
void
WriteGPROperation::Execute(ProcessMonitor *monitor)
{
+#ifdef PT_SETREGS
if (PTRACE(PTRACE_SETREGS, m_tid, NULL, m_buf, m_buf_size) < 0)
m_result = false;
else
m_result = true;
+#else
+ m_result = false;
+#endif
}
//------------------------------------------------------------------------------
@@ -677,10 +693,14 @@
void
WriteFPROperation::Execute(ProcessMonitor *monitor)
{
+#ifdef PT_SETFPREGS
if (PTRACE(PTRACE_SETFPREGS, m_tid, NULL, m_buf, m_buf_size) < 0)
m_result = false;
else
m_result = true;
+#else
+ m_result = false;
+#endif
}
//------------------------------------------------------------------------------