diff options
author | Oleksiy Vyalov <ovyalov@google.com> | 2014-11-13 18:22:16 +0000 |
---|---|---|
committer | Oleksiy Vyalov <ovyalov@google.com> | 2014-11-13 18:22:16 +0000 |
commit | 1339b5e8ae6c28f08d20d0df93e5f21e79cf030e (patch) | |
tree | 784ebc4d668dc77931872f29e465d03a31784e5c /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | |
parent | 631cc9ce1aeadd052aa1d4860210256cdd6e22ac (diff) | |
download | bcm5719-llvm-1339b5e8ae6c28f08d20d0df93e5f21e79cf030e.tar.gz bcm5719-llvm-1339b5e8ae6c28f08d20d0df93e5f21e79cf030e.zip |
Refactor NativeProcessLinux::AttachToProcess in order to avoid reinterpret_cast from NativeProcessProtocol* to NativeProcessLinux*.
llvm-svn: 221906
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index 4c53346e9c7..f13b715612d 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1298,22 +1298,19 @@ NativeProcessLinux::AttachToProcess ( if (!error.Success ()) return error; - native_process_sp.reset (new NativeProcessLinux ()); + std::shared_ptr<NativeProcessLinux> native_process_linux_sp (new NativeProcessLinux ()); - if (!native_process_sp->RegisterNativeDelegate (native_delegate)) + if (!native_process_linux_sp->RegisterNativeDelegate (native_delegate)) { - native_process_sp.reset (new NativeProcessLinux ()); error.SetErrorStringWithFormat ("failed to register the native delegate"); return error; } - reinterpret_cast<NativeProcessLinux*> (native_process_sp.get ())->AttachToInferior (pid, error); + native_process_linux_sp->AttachToInferior (pid, error); if (!error.Success ()) - { - native_process_sp.reset (); return error; - } + native_process_sp = native_process_linux_sp; return error; } |