[Lldb-commits] [lldb] r211503 - lldb: deal with non-portable PTRACE-related constants
Todd Fiala
todd.fiala at gmail.com
Mon Jun 23 08:59:04 PDT 2014
Author: tfiala
Date: Mon Jun 23 10:59:04 2014
New Revision: 211503
URL: http://llvm.org/viewvc/llvm-project?rev=211503&view=rev
Log:
lldb: deal with non-portable PTRACE-related constants
See http://reviews.llvm.org/D4091 for details.
Change by Paul Osmialowski.
Modified:
lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp?rev=211503&r1=211502&r2=211503&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp Mon Jun 23 10:59:04 2014
@@ -122,18 +122,22 @@ static void PtraceDisplayBytes(int &req,
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 @@ private:
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 @@ private:
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 @@ private:
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 @@ private:
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
}
//------------------------------------------------------------------------------
More information about the lldb-commits
mailing list