summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-11-10 11:05:49 +0000
committerPavel Labath <labath@google.com>2017-11-10 11:05:49 +0000
commitd37349f380a405fc7224c79ca41b28a69672500f (patch)
treec140b002a6c7ce05d38101d462bf9fdb00ea192d /lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
parentbd5c522e4db8a9783eb9150e62bc8329d2a1d7c6 (diff)
downloadbcm5719-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_x86_64.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
index e44e03b46b5..b86b8253b6c 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
@@ -243,12 +243,11 @@ static inline unsigned int fxsr_regset(const ArchSpec &arch) {
#define mask_XSTATE_BNDCFG (1ULL << 4)
#define mask_XSTATE_MPX (mask_XSTATE_BNDREGS | mask_XSTATE_BNDCFG)
-NativeRegisterContextLinux *
+std::unique_ptr<NativeRegisterContextLinux>
NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
- const ArchSpec &target_arch, NativeThreadProtocol &native_thread,
- uint32_t concrete_frame_idx) {
- return new NativeRegisterContextLinux_x86_64(target_arch, native_thread,
- concrete_frame_idx);
+ const ArchSpec &target_arch, NativeThreadProtocol &native_thread) {
+ return std::unique_ptr<NativeRegisterContextLinux>(
+ new NativeRegisterContextLinux_x86_64(target_arch, native_thread));
}
// ----------------------------------------------------------------------------
@@ -270,9 +269,8 @@ CreateRegisterInfoInterface(const ArchSpec &target_arch) {
}
NativeRegisterContextLinux_x86_64::NativeRegisterContextLinux_x86_64(
- 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,
CreateRegisterInfoInterface(target_arch)),
m_xstate_type(XStateType::Invalid), m_fpr(), m_iovec(), m_ymm_set(),
m_mpx_set(), m_reg_info(), m_gpr_x86_64() {
OpenPOWER on IntegriCloud