diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-08-23 17:23:12 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-08-23 17:23:12 +0000 |
commit | bf2a8a287814f2a50fa875420d84c1c8a99b22fc (patch) | |
tree | f856d6beca1e8e0d514dd597a385f1c707e6b9af /lldb | |
parent | fe3a5bfb25cf38d4a5d411d336af92bbfb3e79c6 (diff) | |
download | bcm5719-llvm-bf2a8a287814f2a50fa875420d84c1c8a99b22fc.tar.gz bcm5719-llvm-bf2a8a287814f2a50fa875420d84c1c8a99b22fc.zip |
Process: fix FXSAVE on x86
The FXSAVE member `ftw` (FPU Tag Word) was given the wrong size (8-bit)
instead of the correct width (16-bit) as per the x87 Programmer's
Manual. Adjust this to ensure that we print out the complete value for
the register.
llvm-svn: 311579
Diffstat (limited to 'lldb')
3 files changed, 3 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py b/lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py index cc1389ca6b0..fe6ce2c25a3 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py @@ -256,7 +256,7 @@ class RegisterCommandsTestCase(TestBase): self.expect( "register read ftag", substrs=[ 'ftag' + ' = ', str( - "0x%0.2x" % + "0x%0.4x" % (reg_value_ftag_initial | ( 1 << fstat_top_pointer_initial)))]) reg_value_ftag_initial = reg_value_ftag_initial | ( diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp index 6563796db12..2cb17cb182e 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp @@ -36,8 +36,7 @@ struct GPR { struct FPR_i386 { uint16_t fctrl; // FPU Control Word (fcw) uint16_t fstat; // FPU Status Word (fsw) - uint8_t ftag; // FPU Tag Word (ftw) - uint8_t reserved_1; // Reserved + uint16_t ftag; // FPU Tag Word (ftw) uint16_t fop; // Last Instruction Opcode (fop) union { struct { diff --git a/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h b/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h index ab2ca2bb6c2..5f6fc295a15 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h @@ -257,8 +257,7 @@ struct XMMReg { struct FXSAVE { uint16_t fctrl; // FPU Control Word (fcw) uint16_t fstat; // FPU Status Word (fsw) - uint8_t ftag; // FPU Tag Word (ftw) - uint8_t reserved_1; // Reserved + uint16_t ftag; // FPU Tag Word (ftw) uint16_t fop; // Last Instruction Opcode (fop) union { struct { |