<div><div dir="auto">This would be nice to merge to 5.0 IMO.  It fixes reading the x87 FPU state.  What do you think Greg?</div><br><div class="gmail_quote"><div>On Wed, Aug 23, 2017 at 10:24 AM Saleem Abdulrasool via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: compnerd<br>
Date: Wed Aug 23 10:23:12 2017<br>
New Revision: 311579<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=311579&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=311579&view=rev</a><br>
Log:<br>
Process: fix FXSAVE on x86<br>
<br>
The FXSAVE member `ftw` (FPU Tag Word) was given the wrong size (8-bit)<br>
instead of the correct width (16-bit) as per the x87 Programmer's<br>
Manual.  Adjust this to ensure that we print out the complete value for<br>
the register.<br>
<br>
Modified:<br>
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py<br>
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp<br>
    lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py?rev=311579&r1=311578&r2=311579&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py?rev=311579&r1=311578&r2=311579&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py Wed Aug 23 10:23:12 2017<br>
@@ -256,7 +256,7 @@ class RegisterCommandsTestCase(TestBase)<br>
             self.expect(<br>
                 "register read ftag", substrs=[<br>
                     'ftag' + ' = ', str(<br>
-                        "0x%0.2x" %<br>
+                        "0x%0.4x" %<br>
                         (reg_value_ftag_initial | (<br>
                             1 << fstat_top_pointer_initial)))])<br>
             reg_value_ftag_initial = reg_value_ftag_initial | (<br>
<br>
Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp?rev=311579&r1=311578&r2=311579&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp?rev=311579&r1=311578&r2=311579&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp (original)<br>
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp Wed Aug 23 10:23:12 2017<br>
@@ -36,8 +36,7 @@ struct GPR {<br>
 struct FPR_i386 {<br>
   uint16_t fctrl;     // FPU Control Word (fcw)<br>
   uint16_t fstat;     // FPU Status Word (fsw)<br>
-  uint8_t ftag;       // FPU Tag Word (ftw)<br>
-  uint8_t reserved_1; // Reserved<br>
+  uint16_t ftag;      // FPU Tag Word (ftw)<br>
   uint16_t fop;       // Last Instruction Opcode (fop)<br>
   union {<br>
     struct {<br>
<br>
Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h?rev=311579&r1=311578&r2=311579&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h?rev=311579&r1=311578&r2=311579&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h (original)<br>
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h Wed Aug 23 10:23:12 2017<br>
@@ -257,8 +257,7 @@ struct XMMReg {<br>
 struct FXSAVE {<br>
   uint16_t fctrl;     // FPU Control Word (fcw)<br>
   uint16_t fstat;     // FPU Status Word (fsw)<br>
-  uint8_t ftag;       // FPU Tag Word (ftw)<br>
-  uint8_t reserved_1; // Reserved<br>
+  uint16_t ftag;      // FPU Tag Word (ftw)<br>
   uint16_t fop;       // Last Instruction Opcode (fop)<br>
   union {<br>
     struct {<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div>