lldb_private::StopInfo now holds onto a ThreadWP (a std::weak_ptr<lldb_private::Thread>) in case the thread goes away while the stop info still exists.

llvm-svn: 180749
This commit is contained in:
Greg Clayton 2013-04-29 23:30:46 +00:00
parent 219df4c0af
commit 46c2b6e605
3 changed files with 489 additions and 433 deletions

View File

@ -40,16 +40,10 @@ public:
bool
IsValid () const;
Thread &
GetThread()
{
return m_thread;
}
const Thread &
lldb::ThreadSP
GetThread() const
{
return m_thread;
return m_thread_wp.lock();
}
// The value of the StopInfo depends on the StopReason.
@ -184,7 +178,7 @@ protected:
//------------------------------------------------------------------
// Classes that inherit from StackID can see and modify these
//------------------------------------------------------------------
Thread & m_thread; // The thread corresponding to the stop reason.
lldb::ThreadWP m_thread_wp; // The thread corresponding to the stop reason.
uint32_t m_stop_id; // The process stop ID for which this stop info is valid
uint32_t m_resume_id; // This is the resume ID when we made this stop ID.
uint64_t m_value; // A generic value that can be used for things pertaining to this stop info

View File

@ -34,7 +34,7 @@ StopInfoMachException::GetDescription ()
{
if (m_description.empty() && m_value != 0)
{
ExecutionContext exe_ctx (m_thread.shared_from_this());
ExecutionContext exe_ctx (m_thread_wp.lock());
Target *target = exe_ctx.GetTargetPtr();
const llvm::Triple::ArchType cpu = target ? target->GetArchitecture().GetMachine() : llvm::Triple::UnknownArch;

File diff suppressed because it is too large Load Diff