diff options
| author | Pavel Labath <labath@google.com> | 2017-11-10 11:05:49 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-11-10 11:05:49 +0000 |
| commit | d37349f380a405fc7224c79ca41b28a69672500f (patch) | |
| tree | c140b002a6c7ce05d38101d462bf9fdb00ea192d /lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp | |
| parent | bd5c522e4db8a9783eb9150e62bc8329d2a1d7c6 (diff) | |
| download | bcm5719-llvm-d37349f380a405fc7224c79ca41b28a69672500f.tar.gz bcm5719-llvm-d37349f380a405fc7224c79ca41b28a69672500f.zip | |
Clean up NativeRegisterContext
Summary:
This commit removes the concrete_frame_idx member from
NativeRegisterContext and related functions, which was always set to
zero and never used.
I also change the native thread class to store a NativeRegisterContext
as a unique_ptr (documenting the ownership) and make sure it is always
initialized (most of the code was already blindly dereferencing the
register context pointer, assuming it would always be present -- this
makes its treatment consistent).
Reviewers: eugene, clayborg, krytarowski
Subscribers: aemerson, sdardis, nemanjai, javed.absar, arichardson, kristof.beyls, kbarton, uweigand, alexandreyy, lldb-commits
Differential Revision: https://reviews.llvm.org/D39837
llvm-svn: 317881
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp index b66117bc1ac..c483260a5b2 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp @@ -112,26 +112,24 @@ static const RegisterSet g_reg_sets_arm64[k_num_register_sets] = { {"Floating Point Registers", "fpu", k_num_fpr_registers_arm64, g_fpu_regnums_arm64}}; -NativeRegisterContextLinux * +std::unique_ptr<NativeRegisterContextLinux> NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( - const ArchSpec &target_arch, NativeThreadProtocol &native_thread, - uint32_t concrete_frame_idx) { + const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { switch (target_arch.GetMachine()) { case llvm::Triple::arm: - return new NativeRegisterContextLinux_arm(target_arch, native_thread, - concrete_frame_idx); + return llvm::make_unique<NativeRegisterContextLinux_arm>(target_arch, + native_thread); case llvm::Triple::aarch64: - return new NativeRegisterContextLinux_arm64(target_arch, native_thread, - concrete_frame_idx); + return llvm::make_unique<NativeRegisterContextLinux_arm64>(target_arch, + native_thread); default: llvm_unreachable("have no register context for architecture"); } } NativeRegisterContextLinux_arm64::NativeRegisterContextLinux_arm64( - const ArchSpec &target_arch, NativeThreadProtocol &native_thread, - uint32_t concrete_frame_idx) - : NativeRegisterContextLinux(native_thread, concrete_frame_idx, + const ArchSpec &target_arch, NativeThreadProtocol &native_thread) + : NativeRegisterContextLinux(native_thread, new RegisterInfoPOSIX_arm64(target_arch)) { switch (target_arch.GetMachine()) { case llvm::Triple::aarch64: |

