<div dir="ltr">This is now in as part of r202887.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 4, 2014 at 2:22 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 folks<br>
<br>
I'm posting this to dev not commits as it's slightly contentious, but when<br>
combined with an earlier posting of mine:<br>
<br>
[Lldb-commits] [PATCH] 32-bit linux Remove WriteRegOperation's explicit GetAsUInt32() call<br>
<br>
this proposal fixes the 32-bit linux debug experience.<br>
<br>
This patch proposes to calculate the offset of an i386 debug offset using a<br>
simple base + multiple sum, instead using offsetof against a structure.<br>
<br>
We all know that there are lots of ways to solve this problem. I'm posting this<br>
one as it is compact and fits with the existing "#define DR_OFFSET(reg_index)"<br>
pattern.<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 202806)<br>
+++ source/Plugins/Process/POSIX/<u></u>RegisterContextLinux_i386.cpp  (working copy)<br>
@@ -83,8 +83,9 @@<br>
 };<br>
<br>
 #define DR_SIZE sizeof(UserArea::u_debugreg[0]<u></u>)<br>
+#define DR_0_OFFSET 0xFC<br>
 #define DR_OFFSET(reg_index) \<br>
-    (LLVM_EXTENSION offsetof(UserArea, u_debugreg[reg_index]))<br>
+    (DR_0_OFFSET + (reg_index * 4))<br>
 #define FPR_SIZE(reg) sizeof(((FPR_i386*)NULL)->reg)<br>
<br>
 //----------------------------<u></u>------------------------------<u></u>-----------------<br>
<br>
<br>
Using the offsetof(struct, element) mantra can be problematic, if the underlying<br>
structure is changed, and has no benefits IMO if the structure is not also used<br>
as a structure.<br>
<br>
Could someone apply this or a similar patch?<br>
<br>
thanks<br>
Matt<br>
<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>