<div dir="ltr"><div>On Fri, Sep 13, 2013 at 11:33 AM, Thirumurthi, Ashok <span dir="ltr"><<a href="mailto:ashok.thirumurthi@intel.com" target="_blank">ashok.thirumurthi@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
One point to consider is if there is scope for some common code between architectures. Note that the list of architectures will only grow (i.e. x32). A future point is to keep POSIX-isms nicely contained. When considering platform-independent remote debugging that is consistent with native-local debugging, we'll want code consistent between platforms to live in one place.<br>
</blockquote></div><div><br></div><div>Here is a first pass at this:</div><div><br></div><a href="http://llvm-reviews.chandlerc.com/D1798">http://llvm-reviews.chandlerc.com/D1798</a><div><br></div><div>It passes all the 64-bit linux tests, although there is still a bit of cleanup I need to do.</div>
<div> - FreeBSD is most likely busted... (I'll contact Ed about working on this when it's a bit more nailed down.)</div><div> - I need to check and fix dwarf / gdb constant values.</div><div> - I don't like the ConvertRegisterKindToRegisterNumber() routines.</div>
<div> - Also don't like the RegisterContextPOSIXProcessMonitor_x86_64::ReadRegister() / WriteRegister() routines.</div><div> - Need to implement RegisterContextPOSIX_i386* so 32-bit LLDB will fully work. (This may come in a second checkin).</div>
<div> - Would love to have xmm00, xmm01, etc. type aliases for mmx, sse, and avx registers.</div><div><br></div><div>If anyone has any general feedback on how any of this looks and/or ideas on more cleanup, please fire away.</div>
<div><br></div><div>Thanks much.</div><div> -Mike</div><div><br></div><div>----</div><div>(lldb i386 target) register read <br></div><div><div>General Purpose Registers:</div><div> eax = 0xffcf2354</div><div> ebx = 0xf7605ff4 </div>
<div> ecx = 0x00000001</div><div> edx = 0x08048980 </div><div> edi = 0x00000000</div><div> esi = 0x00000000</div><div> ebp = 0xffcf22b8</div><div> esp = 0xffcf1f40</div><div> eip = 0x080486b2 sse32`main + 258 at sse.cpp:40</div>
<div> eflags = 0x00000282</div><div> cs = 0x00000023</div><div> fs = 0x00000000</div><div> gs = 0x00000063</div><div> ss = 0x0000002b</div><div> ds = 0x0000002b</div><div> es = 0x0000002b</div>
</div><div><br></div><div>(lldb x64 target) register read <br></div><div><div>General Purpose Registers:</div><div> rax = 0x0000000000400ce0 </div><div> rbx = 0x0000000000000000</div><div> rcx = 0x0000000000000040</div>
<div> rdx = 0x00007fff03d15e38</div><div> rdi = 0x0000000000000001</div><div> rsi = 0x00007fff03d15e28</div><div> rbp = 0x00007fff03d15d40</div><div> rsp = 0x00007fff03d15960</div><div> r8 = 0x0000000000400c30 sse64`__libc_csu_fini</div>
<div> r9 = 0x00007fa459ca1740 ld-linux-x86-64.so.2`_dl_fini at dl-fini.c:133</div><div> r10 = 0x00007fff03d15ba0</div><div> r11 = 0x00007fa458cc1680 libc.so.6`__libc_start_main at libc-start.c:96</div>
<div> r12 = 0x0000000000400650 sse64`_start</div><div> r13 = 0x00007fff03d15e20</div><div> r14 = 0x0000000000000000</div><div> r15 = 0x0000000000000000</div><div> rip = 0x0000000000400774 sse64`main + 52 at sse.cpp:32</div>
<div> rflags = 0x0000000000000206</div><div> cs = 0x0000000000000033</div><div> fs = 0x0000000000000000</div><div> gs = 0x0000000000000000</div><div> ss = 0x000000000000002b</div><div> ds = 0x0000000000000000</div>
<div> es = 0x0000000000000000</div></div><div><br></div><div> I also added a bunch of register aliases (ax, ah, al, etc.) which you can set via "register read -a".<br></div><div><br></div><div><div>General Purpose Registers:</div>
<div> eax = 0xffd22ac4</div><div> ebx = 0xf75b7ff4 </div><div> ecx = 0x00000001</div><div> edx = 0x08048980 </div><div> edi = 0x00000000</div><div> esi = 0x00000000</div><div> ebp = 0xffd22a28</div>
<div> esp = 0xffd226c0</div><div> eip = 0x080485e4 sse32`main + 52 at sse.cpp:32</div><div> eflags = 0x00000286</div><div> cs = 0x00000023</div><div> fs = 0x00000000</div><div> gs = 0x00000063</div>
<div> ss = 0x0000002b</div><div> ds = 0x0000002b</div><div> es = 0x0000002b</div><div> ax = 0x2ac4</div><div> bx = 0x7ff4</div><div> cx = 0x0001</div><div> dx = 0x8980</div>
<div> di = 0x0000</div><div> si = 0x0000</div><div> bp = 0x2a28</div><div> sp = 0x26c0</div><div> ah = 0xc4</div><div> bh = 0xf4</div><div> ch = 0x01</div><div> dh = 0x80</div>
<div> al = 0xc4</div><div> bl = 0xf4</div><div> cl = 0x01</div><div> dl = 0x80</div><div> dil = 0x00</div><div> sil = 0x00</div><div> bpl = 0x28</div><div> spl = 0xc0</div>
</div><div>...</div></div>