diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-07-19 07:03:07 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-07-19 07:03:07 +0000 |
commit | a884e649599e13d58ce6d2b2a0ce8091ceb48dac (patch) | |
tree | f527514e113dd4f771eef3d39e5a5d2da36b8552 /source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp | |
parent | e75e363cb71a7339552b9d943e78ac62b737379b (diff) | |
download | src-a884e649599e13d58ce6d2b2a0ce8091ceb48dac.tar.gz src-a884e649599e13d58ce6d2b2a0ce8091ceb48dac.zip |
Vendor import of lldb trunk r308421:vendor/lldb/lldb-trunk-r308421
Notes
Notes:
svn path=/vendor/lldb/dist/; revision=321194
svn path=/vendor/lldb/lldb-trunk-r308421/; revision=321195; tag=vendor/lldb/lldb-trunk-r308421
Diffstat (limited to 'source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp')
-rw-r--r-- | source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp b/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp index b9ef02efa65d..388989a21f76 100644 --- a/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp +++ b/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp @@ -64,7 +64,7 @@ static Status EnsureFDFlags(int fd, int flags) { // Public Static Methods // ----------------------------------------------------------------------------- -llvm::Expected<NativeProcessProtocolSP> +llvm::Expected<std::unique_ptr<NativeProcessProtocol>> NativeProcessNetBSD::Factory::Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, MainLoop &mainloop) const { @@ -101,24 +101,25 @@ NativeProcessNetBSD::Factory::Launch(ProcessLaunchInfo &launch_info, LLDB_LOG(log, "pid = {0:x}, detected architecture {1}", pid, arch.GetArchitectureName()); - std::shared_ptr<NativeProcessNetBSD> process_sp(new NativeProcessNetBSD( + std::unique_ptr<NativeProcessNetBSD> process_up(new NativeProcessNetBSD( pid, launch_info.GetPTY().ReleaseMasterFileDescriptor(), native_delegate, arch, mainloop)); - status = process_sp->ReinitializeThreads(); + status = process_up->ReinitializeThreads(); if (status.Fail()) return status.ToError(); - for (const auto &thread_sp : process_sp->m_threads) { + for (const auto &thread_sp : process_up->m_threads) { static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal( SIGSTOP); } - process_sp->SetState(StateType::eStateStopped); + process_up->SetState(StateType::eStateStopped); - return process_sp; + return std::move(process_up); } -llvm::Expected<NativeProcessProtocolSP> NativeProcessNetBSD::Factory::Attach( +llvm::Expected<std::unique_ptr<NativeProcessProtocol>> +NativeProcessNetBSD::Factory::Attach( lldb::pid_t pid, NativeProcessProtocol::NativeDelegate &native_delegate, MainLoop &mainloop) const { Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS)); @@ -130,14 +131,14 @@ llvm::Expected<NativeProcessProtocolSP> NativeProcessNetBSD::Factory::Attach( if (!status.Success()) return status.ToError(); - std::shared_ptr<NativeProcessNetBSD> process_sp( + std::unique_ptr<NativeProcessNetBSD> process_up( new NativeProcessNetBSD(pid, -1, native_delegate, arch, mainloop)); - status = process_sp->Attach(); + status = process_up->Attach(); if (!status.Success()) return status.ToError(); - return process_sp; + return std::move(process_up); } // ----------------------------------------------------------------------------- @@ -787,7 +788,7 @@ NativeThreadNetBSDSP NativeProcessNetBSD::AddThread(lldb::tid_t thread_id) { if (m_threads.empty()) SetCurrentThreadID(thread_id); - auto thread_sp = std::make_shared<NativeThreadNetBSD>(this, thread_id); + auto thread_sp = std::make_shared<NativeThreadNetBSD>(*this, thread_id); m_threads.push_back(thread_sp); return thread_sp; } |