diff options
author | Michael Sartain <mikesart@valvesoftware.com> | 2013-07-31 23:27:46 +0000 |
---|---|---|
committer | Michael Sartain <mikesart@valvesoftware.com> | 2013-07-31 23:27:46 +0000 |
commit | 9f822cd1ec166a777d9d20f0595abe99844b0a60 (patch) | |
tree | 48cf3117df23a044a75a5153d852992dcab16dd4 /lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp | |
parent | 395958ea6f8c435cc57caae59a02166afc141d1c (diff) | |
download | bcm5719-llvm-9f822cd1ec166a777d9d20f0595abe99844b0a60.tar.gz bcm5719-llvm-9f822cd1ec166a777d9d20f0595abe99844b0a60.zip |
Fix thread name updating in Linux. "thread list" should report correct names always now.
Created new LinuxThread class inherited from POSIXThread and removed linux / freebsd ifdefs
Removed several un-needed set thread name calls
CR (and multiple suggestions): mkopec
llvm-svn: 187545
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp index cfb816a1d51..e52d07ce58a 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp @@ -1098,7 +1098,6 @@ ProcessMonitor::Launch(LaunchArgs *args) lldb::pid_t pid; lldb::ThreadSP inferior; - POSIXThread *thread; Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS)); // Propagate the environment if one is not supplied. @@ -1232,10 +1231,7 @@ ProcessMonitor::Launch(LaunchArgs *args) // Update the process thread list with this new thread. // FIXME: should we be letting UpdateThreadList handle this? // FIXME: by using pids instead of tids, we can only support one thread. - inferior.reset(new POSIXThread(process, pid)); - - thread = static_cast<POSIXThread*>(inferior.get()); - thread->SetName(Host::GetThreadName(pid, pid).c_str()); + inferior.reset(process.CreateNewPOSIXThread(process, pid)); if (log) log->Printf ("ProcessMonitor::%s() adding pid = %" PRIu64, __FUNCTION__, pid); @@ -1297,7 +1293,6 @@ ProcessMonitor::Attach(AttachArgs *args) ProcessMonitor *monitor = args->m_monitor; ProcessLinux &process = monitor->GetProcess(); lldb::ThreadSP inferior; - POSIXThread *thread; Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS)); // Use a map to keep track of the threads which we have attached/need to attach. @@ -1362,10 +1357,7 @@ ProcessMonitor::Attach(AttachArgs *args) } // Update the process thread list with the attached thread. - inferior.reset(new POSIXThread(process, tid)); - - thread = static_cast<POSIXThread*>(inferior.get()); - thread->SetName(Host::GetThreadName(pid, tid).c_str()); + inferior.reset(process.CreateNewPOSIXThread(process, tid)); if (log) log->Printf ("ProcessMonitor::%s() adding tid = %" PRIu64, __FUNCTION__, tid); |