Author: Pavel Labath Date: 2021-03-30T11:45:17+02:00 New Revision: d1486e65a1645ca00c3e3109e4e4bb72df1082c3
URL: https://github.com/llvm/llvm-project/commit/d1486e65a1645ca00c3e3109e4e4bb72df1082c3 DIFF: https://github.com/llvm/llvm-project/commit/d1486e65a1645ca00c3e3109e4e4bb72df1082c3.diff LOG: [lldb] Change CreateHostNativeRegisterContextLinux argument type to NativeThreadLinux. This avoid casts down the line. Added: Modified: lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp Removed: ################################################################################ diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h index fa067b78d1768..dfd0106837853 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h @@ -15,6 +15,8 @@ namespace lldb_private { namespace process_linux { +class NativeThreadLinux; + class NativeRegisterContextLinux : public virtual NativeRegisterContextRegisterInfo { public: @@ -24,7 +26,7 @@ class NativeRegisterContextLinux // variant should be compiled into the final executable. static std::unique_ptr<NativeRegisterContextLinux> CreateHostNativeRegisterContextLinux(const ArchSpec &target_arch, - NativeThreadProtocol &native_thread); + NativeThreadLinux &native_thread); // Invalidates cached values in register context data structures virtual void InvalidateAllRegisters(){} diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp index e15e0f8a5651c..2bc2a923298d9 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp @@ -47,7 +47,7 @@ using namespace lldb_private::process_linux; std::unique_ptr<NativeRegisterContextLinux> NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( - const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { + const ArchSpec &target_arch, NativeThreadLinux &native_thread) { return std::make_unique<NativeRegisterContextLinux_arm>(target_arch, native_thread); } diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp index fbaa7e6f5b802..5c025c0ecb43a 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp @@ -41,7 +41,7 @@ using namespace lldb_private::process_linux; std::unique_ptr<NativeRegisterContextLinux> NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( - const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { + const ArchSpec &target_arch, NativeThreadLinux &native_thread) { switch (target_arch.GetMachine()) { case llvm::Triple::arm: return std::make_unique<NativeRegisterContextLinux_arm>(target_arch, diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp index 5abbab11d11d5..4c8ad65b66a38 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp @@ -78,7 +78,7 @@ using namespace lldb_private::process_linux; std::unique_ptr<NativeRegisterContextLinux> NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( - const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { + const ArchSpec &target_arch, NativeThreadLinux &native_thread) { return std::make_unique<NativeRegisterContextLinux_mips64>(target_arch, native_thread); } diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp index 22acbda8ebb9a..4531148c3fdc9 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp @@ -115,7 +115,7 @@ static const RegisterSet g_reg_sets_ppc64le[k_num_register_sets] = { std::unique_ptr<NativeRegisterContextLinux> NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( - const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { + const ArchSpec &target_arch, NativeThreadLinux &native_thread) { switch (target_arch.GetMachine()) { case llvm::Triple::ppc64le: return std::make_unique<NativeRegisterContextLinux_ppc64le>(target_arch, diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp index 098aa348c62d0..beae2da756a81 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp @@ -93,7 +93,7 @@ static const RegisterSet g_reg_sets_s390x[k_num_register_sets] = { std::unique_ptr<NativeRegisterContextLinux> NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( - const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { + const ArchSpec &target_arch, NativeThreadLinux &native_thread) { return std::make_unique<NativeRegisterContextLinux_s390x>(target_arch, native_thread); } diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp index c6aa320c0c142..c197d70825b4b 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp @@ -10,14 +10,14 @@ #include "NativeRegisterContextLinux_x86_64.h" +#include "Plugins/Process/Linux/NativeThreadLinux.h" +#include "Plugins/Process/Utility/RegisterContextLinux_i386.h" +#include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h" #include "lldb/Host/HostInfo.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/RegisterValue.h" #include "lldb/Utility/Status.h" - -#include "Plugins/Process/Utility/RegisterContextLinux_i386.h" -#include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h" #include <cpuid.h> #include <linux/elf.h> @@ -250,7 +250,7 @@ static inline unsigned int fxsr_regset(const ArchSpec &arch) { std::unique_ptr<NativeRegisterContextLinux> NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( - const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { + const ArchSpec &target_arch, NativeThreadLinux &native_thread) { return std::unique_ptr<NativeRegisterContextLinux>( new NativeRegisterContextLinux_x86_64(target_arch, native_thread)); } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits