diff options
| author | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-07-09 16:44:27 +0000 |
|---|---|---|
| committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-07-09 16:44:27 +0000 |
| commit | 214f3a8a7893da603856038bfbfac7a945a3db92 (patch) | |
| tree | dd9d21e92c2829d67a07cb5330e68ee82a8550a6 /lldb/source/Plugins/Process/Linux | |
| parent | 52cf8e44880bcf614068b66b63393aa8da1edd76 (diff) | |
| download | bcm5719-llvm-214f3a8a7893da603856038bfbfac7a945a3db92.tar.gz bcm5719-llvm-214f3a8a7893da603856038bfbfac7a945a3db92.zip | |
Use shared pointers to hold the process in ProcessMonitor
llvm-svn: 185946
Diffstat (limited to 'lldb/source/Plugins/Process/Linux')
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp | 10 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/ProcessMonitor.h | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp index fe617987baa..ab340023e5e 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp @@ -923,7 +923,7 @@ ProcessMonitor::AttachArgs::~AttachArgs() /// launching or attaching to the inferior process, and then 2) servicing /// operations such as register reads/writes, stepping, etc. See the comments /// on the Operation class for more info as to why this is needed. -ProcessMonitor::ProcessMonitor(ProcessPOSIX *process, +ProcessMonitor::ProcessMonitor(ProcessPOSIXSP &process, Module *module, const char *argv[], const char *envp[], @@ -932,7 +932,7 @@ ProcessMonitor::ProcessMonitor(ProcessPOSIX *process, const char *stderr_path, const char *working_dir, lldb_private::Error &error) - : m_process(static_cast<ProcessLinux *>(process)), + : m_process(static_pointer_cast<ProcessLinux>(process)), m_operation_thread(LLDB_INVALID_HOST_THREAD), m_monitor_thread(LLDB_INVALID_HOST_THREAD), m_pid(LLDB_INVALID_PROCESS_ID), @@ -988,10 +988,10 @@ WAIT_AGAIN: } } -ProcessMonitor::ProcessMonitor(ProcessPOSIX *process, +ProcessMonitor::ProcessMonitor(ProcessPOSIXSP &process, lldb::pid_t pid, lldb_private::Error &error) - : m_process(static_cast<ProcessLinux *>(process)), + : m_process(static_pointer_cast<ProcessLinux>(process)), m_operation_thread(LLDB_INVALID_HOST_THREAD), m_monitor_thread(LLDB_INVALID_HOST_THREAD), m_pid(LLDB_INVALID_PROCESS_ID), @@ -1412,7 +1412,7 @@ ProcessMonitor::MonitorCallback(void *callback_baton, { ProcessMessage message; ProcessMonitor *monitor = static_cast<ProcessMonitor*>(callback_baton); - ProcessLinux *process = monitor->m_process; + ProcessLinux *process = monitor->m_process.get(); assert(process); bool stop_monitoring; siginfo_t info; diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.h b/lldb/source/Plugins/Process/Linux/ProcessMonitor.h index dfb4601b9ab..ae965ba323d 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.h +++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.h @@ -47,7 +47,7 @@ public: /// Launches an inferior process ready for debugging. Forms the /// implementation of Process::DoLaunch. - ProcessMonitor(ProcessPOSIX *process, + ProcessMonitor(ProcessPOSIXSP &process, lldb_private::Module *module, char const *argv[], char const *envp[], @@ -57,7 +57,7 @@ public: const char *working_dir, lldb_private::Error &error); - ProcessMonitor(ProcessPOSIX *process, + ProcessMonitor(ProcessPOSIXSP &process, lldb::pid_t pid, lldb_private::Error &error); @@ -182,7 +182,7 @@ public: StopThread(lldb::tid_t tid); private: - ProcessLinux *m_process; + std::shared_ptr<ProcessLinux> m_process; lldb::thread_t m_operation_thread; lldb::thread_t m_monitor_thread; |

