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_arm.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_arm.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp index 22b7d10869f..cb05416cb6c 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp @@ -11,15 +11,15 @@ #include "NativeRegisterContextLinux_arm.h" +#include "Plugins/Process/Linux/NativeProcessLinux.h" +#include "Plugins/Process/Linux/Procfs.h" +#include "Plugins/Process/POSIX/ProcessPOSIXLog.h" +#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/Status.h" -#include "Plugins/Process/Linux/Procfs.h" -#include "Plugins/Process/POSIX/ProcessPOSIXLog.h" -#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h" - #include <elf.h> #include <sys/socket.h> @@ -95,20 +95,18 @@ static const RegisterSet g_reg_sets_arm[k_num_register_sets] = { #if defined(__arm__) -NativeRegisterContextLinux * +std::unique_ptr<NativeRegisterContextLinux> NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( - const ArchSpec &target_arch, NativeThreadProtocol &native_thread, - uint32_t concrete_frame_idx) { - return new NativeRegisterContextLinux_arm(target_arch, native_thread, - concrete_frame_idx); + const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { + return llvm::make_unique<NativeRegisterContextLinux_arm>(target_arch, + native_thread); } #endif // defined(__arm__) NativeRegisterContextLinux_arm::NativeRegisterContextLinux_arm( - 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_arm(target_arch)) { switch (target_arch.GetMachine()) { case llvm::Triple::arm: |

