summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.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_ppc64le.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_ppc64le.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
index 6e275d1662f..ea854dfa1dc 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
@@ -111,23 +111,21 @@ static const RegisterSet g_reg_sets_ppc64le[k_num_register_sets] = {
g_vsx_regnums_ppc64le},
};
-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::ppc64le:
- return new NativeRegisterContextLinux_ppc64le(target_arch, native_thread,
- concrete_frame_idx);
+ return llvm::make_unique<NativeRegisterContextLinux_ppc64le>(target_arch,
+ native_thread);
default:
llvm_unreachable("have no register context for architecture");
}
}
NativeRegisterContextLinux_ppc64le::NativeRegisterContextLinux_ppc64le(
- 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_ppc64le(target_arch)) {
if (target_arch.GetMachine() != llvm::Triple::ppc64le) {
llvm_unreachable("Unhandled target architecture.");
OpenPOWER on IntegriCloud