Author: tkrasnukha Date: Tue Aug 27 10:22:03 2019 New Revision: 370078 URL: http://llvm.org/viewvc/llvm-project?rev=370078&view=rev Log: [lldb] Fix x86 compilation
Differential Revision: https://reviews.llvm.org/D66655 Patch by Leonid Mashinskiy Modified: lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.h lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.h lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.h Modified: lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp?rev=370078&r1=370077&r2=370078&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp (original) +++ lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp Tue Aug 27 10:22:03 2019 @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#if defined(_WIN64) +#if defined(__x86_64__) || defined(_M_X64) #include "NativeRegisterContextWindows_WoW64.h" @@ -265,9 +265,9 @@ Status NativeRegisterContextWindows_WoW6 const uint32_t reg = reg_info->kinds[lldb::eRegisterKindLLDB]; if (reg == LLDB_INVALID_REGNUM) { // This is likely an internal register for lldb use only and should not be - // directly queried. + // directly written. error.SetErrorStringWithFormat("register \"%s\" is an internal-only lldb " - "register, cannot read directly", + "register, cannot write directly", reg_info->name); return error; } @@ -359,4 +359,4 @@ uint32_t NativeRegisterContextWindows_Wo return 0; } -#endif // defined(_WIN64) +#endif // defined(__x86_64__) || defined(_M_X64) Modified: lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.h?rev=370078&r1=370077&r2=370078&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.h (original) +++ lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.h Tue Aug 27 10:22:03 2019 @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#if defined(_WIN64) +#if defined(__x86_64__) || defined(_M_X64) #ifndef liblldb_NativeRegisterContextWindows_WoW64_h_ #define liblldb_NativeRegisterContextWindows_WoW64_h_ @@ -71,4 +71,4 @@ private: } // namespace lldb_private #endif // liblldb_NativeRegisterContextWindows_WoW64_h_ -#endif // defined(_WIN64) +#endif // defined(__x86_64__) || defined(_M_X64) Modified: lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp?rev=370078&r1=370077&r2=370078&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp (original) +++ lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp Tue Aug 27 10:22:03 2019 @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#if defined(_WIN32) && !defined(_WIN64) +#if defined(__i386__) || defined(_M_IX86) #include "NativeRegisterContextWindows_i386.h" @@ -242,7 +242,6 @@ Status NativeRegisterContextWindows_i386::ReadRegister(const RegisterInfo *reg_info, RegisterValue ®_value) { Status error; - Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_REGISTERS); if (!reg_info) { error.SetErrorString("reg_info NULL"); @@ -267,7 +266,6 @@ NativeRegisterContextWindows_i386::ReadR Status NativeRegisterContextWindows_i386::WriteRegister( const RegisterInfo *reg_info, const RegisterValue ®_value) { - Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_REGISTERS); Status error; if (!reg_info) { @@ -278,20 +276,20 @@ Status NativeRegisterContextWindows_i386 const uint32_t reg = reg_info->kinds[lldb::eRegisterKindLLDB]; if (reg == LLDB_INVALID_REGNUM) { // This is likely an internal register for lldb use only and should not be - // directly queried. + // directly written. error.SetErrorStringWithFormat("register \"%s\" is an internal-only lldb " - "register, cannot read directly", + "register, cannot write directly", reg_info->name); return error; } if (IsGPR(reg)) - return GPRRead(reg, reg_value); + return GPRWrite(reg, reg_value); return Status("unimplemented"); } -Status NativeRegisterContextWindows_x86_64::ReadAllRegisterValues( +Status NativeRegisterContextWindows_i386::ReadAllRegisterValues( lldb::DataBufferSP &data_sp) { const size_t data_size = REG_CONTEXT_SIZE; data_sp = std::make_shared<DataBufferHeap>(data_size, 0); Modified: lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.h?rev=370078&r1=370077&r2=370078&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.h (original) +++ lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.h Tue Aug 27 10:22:03 2019 @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#if defined(_WIN64) +#if defined(__i386__) || defined(_M_IX86) #ifndef liblldb_NativeRegisterContextWindows_i386_h_ #define liblldb_NativeRegisterContextWindows_i386_h_ @@ -71,4 +71,4 @@ private: } // namespace lldb_private #endif // liblldb_NativeRegisterContextWindows_i386_h_ -#endif // defined(_WIN64) +#endif // defined(__i386__) || defined(_M_IX86) Modified: lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp?rev=370078&r1=370077&r2=370078&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp (original) +++ lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp Tue Aug 27 10:22:03 2019 @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#if defined(_WIN64) +#if defined(__x86_64__) || defined(_M_X64) #include "NativeRegisterContextWindows_x86_64.h" #include "NativeRegisterContextWindows_WoW64.h" @@ -476,9 +476,9 @@ Status NativeRegisterContextWindows_x86_ const uint32_t reg = reg_info->kinds[lldb::eRegisterKindLLDB]; if (reg == LLDB_INVALID_REGNUM) { // This is likely an internal register for lldb use only and should not be - // directly queried. + // directly written. error.SetErrorStringWithFormat("register \"%s\" is an internal-only lldb " - "register, cannot read directly", + "register, cannot write directly", reg_info->name); return error; } @@ -576,4 +576,4 @@ NativeRegisterContextWindows_x86_64::Num return 0; } -#endif // defined(_WIN64) +#endif // defined(__x86_64__) || defined(_M_X64) Modified: lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.h?rev=370078&r1=370077&r2=370078&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.h (original) +++ lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.h Tue Aug 27 10:22:03 2019 @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#if defined(_WIN64) +#if defined(__x86_64__) || defined(_M_X64) #ifndef liblldb_NativeRegisterContextWindows_x86_64_h_ #define liblldb_NativeRegisterContextWindows_x86_64_h_ @@ -79,4 +79,4 @@ private: } // namespace lldb_private #endif // liblldb_NativeRegisterContextWindows_x86_64_h_ -#endif // defined(_WIN64) +#endif // defined(__x86_64__) || defined(_M_X64) _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits