<div dir="ltr">Ok - so Jason, your patch is fine to submit?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 12, 2014 at 5:22 PM, Tong Shen <span dir="ltr"><<a href="mailto:endlessroad@google.com" target="_blank">endlessroad@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">Sorry just saw this.. Agree.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Aug 12, 2014 at 5:08 PM, Jason Molenda <span dir="ltr"><<a href="mailto:jmolenda@apple.com" target="_blank">jmolenda@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I believe the correct patch looks closer to<br>
<br>
Index: RegisterContext_x86.h<br>
===================================================================<br>
--- RegisterContext_x86.h       (revision 215178)<br>
+++ RegisterContext_x86.h       (working copy)<br>
@@ -34,8 +34,8 @@<br>
     gcc_ecx_i386,<br>
     gcc_edx_i386,<br>
     gcc_ebx_i386,<br>
-    gcc_ebp_i386, // Warning: these are switched from dwarf values<br>
-    gcc_esp_i386, //<br>
+    gcc_esp_i386,  // on Darwin esp & ebp are reversed in the eh_frame section for i386.<br>
+    gcc_ebp_i386,  // lldb will get those darwin-specific reg mappings from debugserver instead of here.<br>
     gcc_esi_i386,<br>
     gcc_edi_i386,<br>
     gcc_eip_i386,<br>
<div><div><br>
<br>
<br>
> On Aug 12, 2014, at 5:05 PM, Todd Fiala <<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>> wrote:<br>
><br>
> Yep, will do later tonight.<br>
><br>
> -Todd<br>
><br>
> On Aug 12, 2014, at 4:32 PM, Tong Shen <<a href="mailto:endlessroad@google.com" target="_blank">endlessroad@google.com</a>> wrote:<br>
><br>
>> Got it. So much magic going on there.<br>
>><br>
>> +Todd Can you check this in? Thanks!<br>
>><br>
>><br>
>> On Tue, Aug 12, 2014 at 4:23 PM, Jason Molenda <<a href="mailto:jmolenda@apple.com" target="_blank">jmolenda@apple.com</a>> wrote:<br>
>><br>
>> > On Aug 12, 2014, at 4:20 PM, Tong Shen <<a href="mailto:endlessroad@google.com" target="_blank">endlessroad@google.com</a>> wrote:<br>
>> ><br>
>> > There's this line in your dwarfdump output:<br>
>> > DW_CFA_def_cfa (5 (esp), 4)<br>
>> > DW_CFA_offset (8 (eip), -4)<br>
>> ><br>
>> > On Ubuntu 14.04, objdump -W outputs this:<br>
>> > DW_CFA_def_cfa: r4 (esp) ofs 4<br>
>> > DW_CFA_offset: r8 (eip) at cfa-4<br>
>> ><br>
>> > I believe this is the cause. On OSX, esp=5; on linux, esp=4<br>
>><br>
>><br>
>> Yeah, I was starting to get that impression too.  I thought the old esp/ebp mixup was across all the gcc platforms - but who knows.  Feel free to fix the RegisterContext_x86 enum definitions for esp/ebp - on Mac OS X we'll still be using the debugserver-provided register definitions.  (and we don't use eh_frame very often on Mac OS X - we primarily use a local compact unwind format that I haven't written an importer for yet)<br>


>><br>
>> Normally this kind of thing would be defined in the processor ABI document -- but I've never been able to find a document like that for IA-32.<br>
>><br>
>><br>
>><br>
>> --<br>
>> Best Regards, Tong Shen<br>
>> <1.patch><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Best Regards, Tong Shen</div>
</div>
</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>