<div dir="ltr">I'll have a look at it.<div><br></div><div>This is essentially what I was driving towards last night, which was that our duplicated version of the truth in sys/user.h was incorrect.</div><div><br></div><div>
I'll give this a run now on my end.  If it works, I will probably also check it in with some other minor changes I made to logging, and an assert I put in for ensuring our custom structure size matches the sys/user.h structure size.</div>
<div><br></div><div>Later I'd suggest we go back and rewrite that code in terms of the official structures for a given platform.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 14, 2014 at 3:39 AM, Matthew Gardiner <span dir="ltr"><<a href="mailto:mg11@csr.com" target="_blank">mg11@csr.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
The register map in RegisterContextLinux_i386.cpp is in disagreement with that seen in /usr/include/sys/user.h. The result is that offset calculations for the dr0-dr7 are incorrect. I've had a look at the source and determined that this can't be fixed portably (i.e. for 32/64-bit) with:<br>

<br>
FXSAVE i387;<br>
<br>
since FXSAVE deploys a union and thus the size of the struct would be the same in either architecture, which would be undesirable. I have fixed this on my system with:<br>
<br>
Index: source/Plugins/Process/POSIX/<u></u>RegisterContextLinux_i386.cpp<br>
==============================<u></u>==============================<u></u>=======<br>
--- source/Plugins/Process/POSIX/<u></u>RegisterContextLinux_i386.cpp  (revision 201399)<br>
+++ source/Plugins/Process/POSIX/<u></u>RegisterContextLinux_i386.cpp  (working copy)<br>
@@ -34,11 +34,23 @@<br>
     uint32_t ss;<br>
 };<br>
<br>
+struct FPR_i386<br>
+{<br>
+  long int cwd;<br>
+  long int swd;<br>
+  long int twd;<br>
+  long int fip;<br>
+  long int fcs;<br>
+  long int foo;<br>
+  long int fos;<br>
+  long int st_space [20];<br>
+};<br>
+<br>
 struct UserArea<br>
 {<br>
     GPR      regs;          // General purpose registers.<br>
     int32_t  fpvalid;       // True if FPU is being used.<br>
-    FXSAVE   i387;          // FPU registers.<br>
+    FPR_i386   i387;        // FPU registers.<br>
     uint32_t tsize;         // Text segment size.<br>
     uint32_t dsize;         // Data segment size.<br>
     uint32_t ssize;         // Stack segment size.<br>
<br>
That is, by repetition of the linux FPR area within the lldb codebase. (I could not use the more obvious FPR as my struct name, as it collided with a previous use of the name).<br>
<br>
Would someone be able to view/consider/submit my patch?<br>
<br>
thanks<br>
Matt<br>
<br>
<br>
<br>
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom<br>

More information can be found at <a href="http://www.csr.com" target="_blank">www.csr.com</a>. Keep up to date with CSR on our technical blog, <a href="http://www.csr.com/blog" target="_blank">www.csr.com/blog</a>, CSR people blog, <a href="http://www.csr.com/people" target="_blank">www.csr.com/people</a>, YouTube, <a href="http://www.youtube.com/user/CSRplc" target="_blank">www.youtube.com/user/CSRplc</a>, Facebook, <a href="http://www.facebook.com/pages/CSR/191038434253534" target="_blank">www.facebook.com/pages/CSR/<u></u>191038434253534</a>, or follow us on Twitter at <a href="http://www.twitter.com/CSR_plc" target="_blank">www.twitter.com/CSR_plc</a>.<br>

New for 2014, you can now access the wide range of products powered by aptX at <a href="http://www.aptx.com" target="_blank">www.aptx.com</a>.<br>
<br>_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<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>