Reverting ProcessMonitor shared pointer changes
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185981 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp b/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
index f3dd7a7..3e36497 100644
--- a/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
+++ b/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
@@ -689,7 +689,7 @@
/// 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(ProcessPOSIXSP &process,
+ProcessMonitor::ProcessMonitor(ProcessPOSIX *process,
Module *module,
const char *argv[],
const char *envp[],
@@ -698,7 +698,7 @@
const char *stderr_path,
const char *working_dir,
lldb_private::Error &error)
- : m_process(static_pointer_cast<ProcessFreeBSD>(process)),
+ : m_process(static_cast<ProcessFreeBSD *>(process)),
m_operation_thread(LLDB_INVALID_HOST_THREAD),
m_monitor_thread(LLDB_INVALID_HOST_THREAD),
m_pid(LLDB_INVALID_PROCESS_ID),
@@ -756,10 +756,10 @@
}
}
-ProcessMonitor::ProcessMonitor(ProcessPOSIXSP &process,
+ProcessMonitor::ProcessMonitor(ProcessPOSIX *process,
lldb::pid_t pid,
lldb_private::Error &error)
- : m_process(static_pointer_cast<ProcessFreeBSD>(process)),
+ : m_process(static_cast<ProcessFreeBSD *>(process)),
m_operation_thread(LLDB_INVALID_HOST_THREAD),
m_monitor_thread(LLDB_INVALID_HOST_THREAD),
m_pid(pid),
@@ -1102,7 +1102,7 @@
{
ProcessMessage message;
ProcessMonitor *monitor = static_cast<ProcessMonitor*>(callback_baton);
- ProcessFreeBSD *process = monitor->m_process.get();
+ ProcessFreeBSD *process = monitor->m_process;
assert(process);
bool stop_monitoring;
siginfo_t info;
diff --git a/source/Plugins/Process/FreeBSD/ProcessMonitor.h b/source/Plugins/Process/FreeBSD/ProcessMonitor.h
index efa840b..d8f3f22 100644
--- a/source/Plugins/Process/FreeBSD/ProcessMonitor.h
+++ b/source/Plugins/Process/FreeBSD/ProcessMonitor.h
@@ -47,7 +47,7 @@
/// Launches an inferior process ready for debugging. Forms the
/// implementation of Process::DoLaunch.
- ProcessMonitor(ProcessPOSIXSP &process,
+ ProcessMonitor(ProcessPOSIX *process,
lldb_private::Module *module,
char const *argv[],
char const *envp[],
@@ -57,7 +57,7 @@
const char *working_dir,
lldb_private::Error &error);
- ProcessMonitor(ProcessPOSIXSP &process,
+ ProcessMonitor(ProcessPOSIX *process,
lldb::pid_t pid,
lldb_private::Error &error);
@@ -192,7 +192,7 @@
private:
- std::shared_ptr<ProcessFreeBSD> m_process;
+ ProcessFreeBSD *m_process;
lldb::thread_t m_operation_thread;
lldb::thread_t m_monitor_thread;
diff --git a/source/Plugins/Process/Linux/ProcessMonitor.cpp b/source/Plugins/Process/Linux/ProcessMonitor.cpp
index ab34002..fe61798 100644
--- a/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -923,7 +923,7 @@
/// 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(ProcessPOSIXSP &process,
+ProcessMonitor::ProcessMonitor(ProcessPOSIX *process,
Module *module,
const char *argv[],
const char *envp[],
@@ -932,7 +932,7 @@
const char *stderr_path,
const char *working_dir,
lldb_private::Error &error)
- : m_process(static_pointer_cast<ProcessLinux>(process)),
+ : m_process(static_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 @@
}
}
-ProcessMonitor::ProcessMonitor(ProcessPOSIXSP &process,
+ProcessMonitor::ProcessMonitor(ProcessPOSIX *process,
lldb::pid_t pid,
lldb_private::Error &error)
- : m_process(static_pointer_cast<ProcessLinux>(process)),
+ : m_process(static_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 @@
{
ProcessMessage message;
ProcessMonitor *monitor = static_cast<ProcessMonitor*>(callback_baton);
- ProcessLinux *process = monitor->m_process.get();
+ ProcessLinux *process = monitor->m_process;
assert(process);
bool stop_monitoring;
siginfo_t info;
diff --git a/source/Plugins/Process/Linux/ProcessMonitor.h b/source/Plugins/Process/Linux/ProcessMonitor.h
index ae965ba..dfb4601 100644
--- a/source/Plugins/Process/Linux/ProcessMonitor.h
+++ b/source/Plugins/Process/Linux/ProcessMonitor.h
@@ -47,7 +47,7 @@
/// Launches an inferior process ready for debugging. Forms the
/// implementation of Process::DoLaunch.
- ProcessMonitor(ProcessPOSIXSP &process,
+ ProcessMonitor(ProcessPOSIX *process,
lldb_private::Module *module,
char const *argv[],
char const *envp[],
@@ -57,7 +57,7 @@
const char *working_dir,
lldb_private::Error &error);
- ProcessMonitor(ProcessPOSIXSP &process,
+ ProcessMonitor(ProcessPOSIX *process,
lldb::pid_t pid,
lldb_private::Error &error);
@@ -182,7 +182,7 @@
StopThread(lldb::tid_t tid);
private:
- std::shared_ptr<ProcessLinux> m_process;
+ ProcessLinux *m_process;
lldb::thread_t m_operation_thread;
lldb::thread_t m_monitor_thread;
diff --git a/source/Plugins/Process/POSIX/ProcessPOSIX.cpp b/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
index 005f558..e09bfca 100644
--- a/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
+++ b/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
@@ -115,8 +115,7 @@
if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
log->Printf ("ProcessPOSIX::%s(pid = %" PRIi64 ")", __FUNCTION__, GetID());
- ProcessPOSIXSP process_sp(static_pointer_cast<ProcessPOSIX>(CalculateProcess()));
- m_monitor = new ProcessMonitor(process_sp, pid, error);
+ m_monitor = new ProcessMonitor(this, pid, error);
if (!error.Success())
return error;
@@ -226,8 +225,7 @@
file_action = launch_info.GetFileActionForFD (STDERR_FILENO);
stderr_path = GetFilePath(file_action, stderr_path);
- ProcessPOSIXSP process_sp(static_pointer_cast<ProcessPOSIX>(CalculateProcess()));
- m_monitor = new ProcessMonitor (process_sp,
+ m_monitor = new ProcessMonitor (this,
module,
launch_info.GetArguments().GetConstArgumentVector(),
launch_info.GetEnvironmentEntries().GetConstArgumentVector(),
diff --git a/source/Plugins/Process/POSIX/ProcessPOSIX.h b/source/Plugins/Process/POSIX/ProcessPOSIX.h
index bda1658..a865fe2 100644
--- a/source/Plugins/Process/POSIX/ProcessPOSIX.h
+++ b/source/Plugins/Process/POSIX/ProcessPOSIX.h
@@ -201,6 +201,4 @@
ThreadStopSet m_seen_initial_stop;
};
-typedef std::shared_ptr<ProcessPOSIX> ProcessPOSIXSP;
-
#endif // liblldb_MacOSXProcess_H_