Author: labath Date: Wed Nov 30 04:17:58 2016 New Revision: 288236 URL: http://llvm.org/viewvc/llvm-project?rev=288236&view=rev Log: Remove an x86-ism from RegisterInfoInterface
Summary: While adding FPR support to x86 elf core files (D26300), we ended up adding a very x86-specific function to the general RegisterInfoInterface class, which I didn't catch in review. This removes that function. The only reason we needed it was to find the offset of the FXSAVE area. This is the same as the offset of the first register within that area, so we might as well use that. Reviewers: clayborg, dvlahovski Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D27222 Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.h lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterInfoInterface.h Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp?rev=288236&r1=288235&r2=288236&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp Wed Nov 30 04:17:58 2016 @@ -111,10 +111,6 @@ RegisterContextLinux_i386::RegisterConte size_t RegisterContextLinux_i386::GetGPRSize() const { return sizeof(GPR); } -size_t RegisterContextLinux_i386::GetFXSAVEOffset() const { - return (LLVM_EXTENSION offsetof(UserArea, i387)); -} - const RegisterInfo *RegisterContextLinux_i386::GetRegisterInfo() const { switch (m_target_arch.GetMachine()) { case llvm::Triple::x86: Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.h?rev=288236&r1=288235&r2=288236&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.h (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.h Wed Nov 30 04:17:58 2016 @@ -18,8 +18,6 @@ public: size_t GetGPRSize() const override; - size_t GetFXSAVEOffset() const override; - const lldb_private::RegisterInfo *GetRegisterInfo() const override; uint32_t GetRegisterCount() const override; Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp?rev=288236&r1=288235&r2=288236&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp Wed Nov 30 04:17:58 2016 @@ -179,11 +179,6 @@ RegisterContextLinux_x86_64::RegisterCon size_t RegisterContextLinux_x86_64::GetGPRSize() const { return sizeof(GPR); } -size_t RegisterContextLinux_x86_64::GetFXSAVEOffset() const { - return (LLVM_EXTENSION offsetof(UserArea, fpr) + - LLVM_EXTENSION offsetof(FPR, xstate)); -} - const std::vector<lldb_private::RegisterInfo> * RegisterContextLinux_x86_64::GetDynamicRegisterInfoP() const { return &d_register_infos; Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h?rev=288236&r1=288235&r2=288236&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h Wed Nov 30 04:17:58 2016 @@ -18,8 +18,6 @@ public: size_t GetGPRSize() const override; - size_t GetFXSAVEOffset() const override; - const lldb_private::RegisterInfo *GetRegisterInfo() const override; uint32_t GetRegisterCount() const override; Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp?rev=288236&r1=288235&r2=288236&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp Wed Nov 30 04:17:58 2016 @@ -420,7 +420,7 @@ size_t RegisterContextPOSIX_x86::GetGPRS } size_t RegisterContextPOSIX_x86::GetFXSAVEOffset() { - return m_register_info_ap->GetFXSAVEOffset(); + return GetRegisterInfo()[m_reg_info.first_fpr].byte_offset; } const RegisterInfo *RegisterContextPOSIX_x86::GetRegisterInfo() { Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterInfoInterface.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterInfoInterface.h?rev=288236&r1=288235&r2=288236&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterInfoInterface.h (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterInfoInterface.h Wed Nov 30 04:17:58 2016 @@ -29,8 +29,6 @@ public: virtual size_t GetGPRSize() const = 0; - virtual size_t GetFXSAVEOffset() const { return 0; } - virtual const lldb_private::RegisterInfo *GetRegisterInfo() const = 0; // Returns the number of registers including the user registers and the _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits