<div dir="ltr">Hi Paul,<div><br></div><div>><span style="font-family:arial,sans-serif;font-size:13px">I guess we're not going to require access to kernel headers for lldb cross-compilation, so your fix should be a better solution.</span></div>
<div><br></div><div>Yeah I think we may want to go back and change that last commit to use the other define-based approach.  That'll allow it to work on systems where the cross-compiler doesn't have the headers but the target really supports the values.  If they're not supported, we'll still get the error on trying to ptrace with the (unsupported) values in that case.  Sound reasonable?</div>
<div><br></div><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">> Is NativeProcessLinux.cpp intented to replace Linux/ProcessMonitor.cpp? I gave your branch a try and found that now, both are compiled.</span><div class="" style="font-family:arial,sans-serif;font-size:13px">
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Right - Greg Clayton and I decided to put the NativeProcessLinux in llgs side-by-side so I didn't have to change the world at the same time I'm trying to get llgs up and running.  The intent was to get NativeProcessProtocol, NativeThreadProtocol, NativeRegisterContext and GDBRemoteCommunicationServer (lldb-gdbserver/lldb-platform) up and running first, working the kinks out of it.  Then, we can rework local debugging and process monitoring to use the Native* classes as a follow-up pass.  That will enable supporting a remote and local debugging scenario for a new os/arch with a single set of code for both remote and local debugging rather than writing a separate remote and local path.</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 23, 2014 at 1:14 PM, Paul Osmialowski <span dir="ltr"><<a href="mailto:pawelo@king.net.pl" target="_blank">pawelo@king.net.pl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Todd,<br>
<br>
These values looks ok. Although they cannot be found in sys/ headers shipped within Linaro's toolchain sysroot for AArch64, I could find them in AArch64-related headers that are part of Linux kernel source code:<br>
<br>
arch/arm64/include/asm/ptrace.<u></u>h:<br>
<br>
/* AArch32-specific ptrace requests */<br>
#define COMPAT_PTRACE_GETREGS           12<br>
#define COMPAT_PTRACE_SETREGS           13<br>
#define COMPAT_PTRACE_GET_THREAD_AREA   22<br>
#define COMPAT_PTRACE_SET_SYSCALL       23<br>
#define COMPAT_PTRACE_GETVFPREGS        27<br>
#define COMPAT_PTRACE_SETVFPREGS        28<br>
#define COMPAT_PTRACE_GETHBPREGS        29<br>
#define COMPAT_PTRACE_SETHBPREGS        30<br>
#define COMPAT_PSR_MODE_USR     0x00000010<br>
#define COMPAT_PSR_T_BIT        0x00000020<br>
#define COMPAT_PSR_IT_MASK      0x0600fc00      /* If-Then execution state mask */<br>
<br>
I guess we're not going to require access to kernel headers for lldb cross-compilation, so your fix should be a better solution.<br>
<br>
Is NativeProcessLinux.cpp intented to replace Linux/ProcessMonitor.cpp? I gave your branch a try and found that now, both are compiled.<div class="HOEnZb"><div class="h5"><br>
<br>
On Mon, 23 Jun 2014, Todd Fiala wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
FWIW on the NativeProcessLinux side (llgs branch) I'm solving this more like how the existing code did it:<br>
--- a/source/Plugins/Process/<u></u>Linux/NativeProcessLinux.cpp<br>
+++ b/source/Plugins/Process/<u></u>Linux/NativeProcessLinux.cpp<br>
@@ -52,6 +52,12 @@<br>
 #define DEBUG_PTRACE_MAXBYTES 20<br>
 <br>
 // Support ptrace extensions even when compiled without required kernel support<br>
+#ifndef PTRACE_GETREGS<br>
+#define PTRACE_GETREGS 12<br>
+#endif<br>
+#ifndef PTRACE_SETREGS<br>
+  #define PTRACE_SETREGS 13<br>
+#endif<br>
 #ifndef PTRACE_GETREGSET<br>
   #define PTRACE_GETREGSET 0x4204<br>
 #endif<br>
<br>
That approach should also clear up the cross compile issues.  More importantly, if it's really running this code on the target, where the ptrace support really does exist, then the code would still run<br>
properly.<br>
<br>
<br>
On Mon, Jun 23, 2014 at 9:07 AM, Todd Fiala <<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>> wrote:<br>
      svn commit<br>
      Sending        source/Plugins/Process/Linux/<u></u>ProcessMonitor.cpp<br>
      Transmitting file data .<br>
      Committed revision 211503.<br>
<br>
      <a href="http://reviews.llvm.org/D4091" target="_blank">http://reviews.llvm.org/D4091</a><br>
<br>
<br>
<br>
<br>
<br>
--<br>
Todd Fiala |<br>
 Software Engineer |<br>
 <a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a> |<br>
 <a href="tel:650-943-3180" value="+16509433180" target="_blank">650-943-3180</a><br>
<br>
</blockquote>
</div></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>