<div dir="ltr">I think per a previous discussion, we can actually remove a few of these lines, too (see bolded blow, the #ifdef checks on the PTRACE_* are really not valid, they should have always been the PT_* values from all the header code I've looked at):<div>
<br></div><div><div><font size="1">+#ifndef PT_GETREGS</font></div><div><font size="1"><b> #ifndef PTRACE_GETREGS</b></font></div><div><font size="1">-#define PTRACE_GETREGS 12</font></div><div><font size="1">+  #define PTRACE_GETREGS 12</font></div>
<div><font size="1"><b> #endif</b></font></div><div><font size="1">+#endif</font></div><div><font size="1">+#ifndef PT_SETREGS</font></div><div><font size="1"><b> #ifndef PTRACE_SETREGS</b></font></div><div><font size="1">   #define PTRACE_SETREGS 13</font></div>
<div><font size="1"><b> #endif</b></font></div><div><font size="1">+#endif</font></div><div><font size="1">+#ifndef PT_GETFPREGS</font></div><div><font size="1"><b>+#ifndef PTRACE_GETFPREGS</b></font></div><div><font size="1">+  #define PTRACE_GETFPREGS 14</font></div>
<div><font size="1"><b>+#endif</b></font></div><div><font size="1">+#endif</font></div><div><font size="1">+#ifndef PT_SETFPREGS</font></div><div><font size="1"><b>+#ifndef PTRACE_SETFPREGS</b></font></div><div><font size="1">+  #define PTRACE_SETFPREGS 15</font></div>
<div><font size="1"><b>+#endif</b></font></div><div><font size="1">+#endif</font></div><div><font size="1"> #ifndef PTRACE_GETREGSET</font></div><div><font size="1">   #define PTRACE_GETREGSET 0x4204</font></div><div><font size="1"> #endif</font></div>
</div><div><br></div><div>Paul, unless you know that will break your scenario, I'd like to pull those out as part of this patch.</div>







</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 2, 2014 at 2:19 PM, Todd Fiala <span dir="ltr"><<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey Paul,<div><br></div><div>It looks fine.  Let me give it a build/test and then I'll check it in.</div>
<div><br></div><div>Thanks!  I had thought I got most of those in the llgs branch but looks like I missed a few.</div>
<div><br></div><div>-Todd</div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Wed, Jul 2, 2014 at 2:09 PM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Looks ok to me if Todd Fiala gives the ok as well.<br>
<div><div><br>
> On Jul 2, 2014, at 1:46 PM, Paul Osmialowski <<a href="mailto:pawelo@king.net.pl" target="_blank">pawelo@king.net.pl</a>> wrote:<br>
><br>
> Today this is the only problem that I'm facing trying to cross-compile lldb for AArch64 using Linaro's toolchain.<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>
> <a href="http://reviews.llvm.org/D4366" target="_blank">http://reviews.llvm.org/D4366</a><br>
><br>
> Files:<br>
>  source/Plugins/Process/Linux/NativeProcessLinux.cpp<br>
><br>
> Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp<br>
> ===================================================================<br>
> --- source/Plugins/Process/Linux/NativeProcessLinux.cpp<br>
> +++ source/Plugins/Process/Linux/NativeProcessLinux.cpp<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>
</div></div>> <D4366.11033.patch>_______________________________________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">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>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">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></div></div><span class="HOEnZb"><font color="#888888">-- <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>
</font></span></div>
</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>