<div dir="ltr">Whoops no his name is not "Paul Paul".  Sorry...  Cut and paste the full last name spelling after writing Paul...<div><br></div><div>Should be:</div><div><span style="font-family:arial,sans-serif;font-size:13px">Change by Paul Osmialowski</span><br style="font-family:arial,sans-serif;font-size:13px">
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 2, 2014 at 2:34 PM, Todd Fiala <span dir="ltr"><<a href="mailto:todd.fiala@gmail.com" target="_blank">todd.fiala@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: tfiala<br>
Date: Wed Jul  2 16:34:04 2014<br>
New Revision: 212225<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=212225&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=212225&view=rev</a><br>
Log:<br>
lldb - problem with some PTRACE_* constants in NativeProcessLinux.cpp file<br>
<br>
See <a href="http://reviews.llvm.org/D4366" target="_blank">http://reviews.llvm.org/D4366</a> for details.<br>
<br>
Change by Paul Paul Osmialowski<br>
<br>
Today this is the only problem that I'm facing trying to cross-compile lldb for AArch64 using Linaro's toolchain.<br>
<br>
PTRACE_GETREGS, PTRACE_SETREGS, PTRACE_GETFPREGS, PTRACE_SETFPREGS are not defined for AArch64<br>
These things can be defined different ways for other architectures, e.g. for x86_64 Linux, asm/ptrace-abi.h defines them as preprocessor constants while sys/ptrace.h defines them in enum along with corresponding PT_* preprocessor constants<br>

NativeProcessLinux.cpp includes sys/ptrace.h<br>
To avoid accidental redefinition of enums with preprocessor constants, I'm proposing this patch which first checks for PT_* preprocessor constants then checks for PTRACE_* constants then when it still can not find them, it defines preprocessor constants.<br>

Similar approach was already used for PTRACE_GETREGSET and PTRACE_SETREGSET constants; in this case however it was easier, since enum values in sys/ptrace.h and preprocessor constants shared all exactly the same names (e.g. there's no additional PT_GETREGSET name defined).<br>

<br>
Modified:<br>
    lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp<br>
<br>
Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=212225&r1=212224&r2=212225&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=212225&r1=212224&r2=212225&view=diff</a><br>

==============================================================================<br>
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)<br>
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Wed Jul  2 16:34:04 2014<br>
@@ -53,12 +53,26 @@<br>
 #define DEBUG_PTRACE_MAXBYTES 20<br>
<br>
 // Support ptrace extensions even when compiled without required kernel support<br>
+#ifndef PT_GETREGS<br>
 #ifndef PTRACE_GETREGS<br>
-#define PTRACE_GETREGS 12<br>
+  #define PTRACE_GETREGS 12<br>
 #endif<br>
+#endif<br>
+#ifndef PT_SETREGS<br>
 #ifndef PTRACE_SETREGS<br>
   #define PTRACE_SETREGS 13<br>
 #endif<br>
+#endif<br>
+#ifndef PT_GETFPREGS<br>
+#ifndef PTRACE_GETFPREGS<br>
+  #define PTRACE_GETFPREGS 14<br>
+#endif<br>
+#endif<br>
+#ifndef PT_SETFPREGS<br>
+#ifndef PTRACE_SETFPREGS<br>
+  #define PTRACE_SETFPREGS 15<br>
+#endif<br>
+#endif<br>
 #ifndef PTRACE_GETREGSET<br>
   #define PTRACE_GETREGSET 0x4204<br>
 #endif<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>