summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
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/NativeThreadLinux.h
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/NativeThreadLinux.h')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeThreadLinux.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
index 01b54d9ec47..a7c4e982012 100644
--- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
+++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
@@ -10,7 +10,8 @@
#ifndef liblldb_NativeThreadLinux_H_
#define liblldb_NativeThreadLinux_H_
-#include "SingleStepCheck.h"
+#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
+#include "Plugins/Process/Linux/SingleStepCheck.h"
#include "lldb/Host/common/NativeThreadProtocol.h"
#include "lldb/lldb-private-forward.h"
@@ -40,7 +41,9 @@ public:
bool GetStopReason(ThreadStopInfo &stop_info,
std::string &description) override;
- NativeRegisterContextSP GetRegisterContext() override;
+ NativeRegisterContextLinux &GetRegisterContext() override {
+ return *m_reg_context_up;
+ }
Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags,
bool hardware) override;
@@ -103,7 +106,7 @@ private:
// ---------------------------------------------------------------------
lldb::StateType m_state;
ThreadStopInfo m_stop_info;
- NativeRegisterContextSP m_reg_context_sp;
+ std::unique_ptr<NativeRegisterContextLinux> m_reg_context_up;
std::string m_stop_description;
using WatchpointIndexMap = std::map<lldb::addr_t, uint32_t>;
WatchpointIndexMap m_watchpoint_index_map;
OpenPOWER on IntegriCloud