summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility/ThreadMemory.h
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-05-01 21:54:04 +0000
committerGreg Clayton <gclayton@apple.com>2013-05-01 21:54:04 +0000
commit160c9d81e07fec2d6299a9f31bb004f1b97419a6 (patch)
tree01aef16f7f4a45a2eb3c37b5083eda3c8e9cc429 /lldb/source/Plugins/Process/Utility/ThreadMemory.h
parent5ed5181178f256f99954f2662547658a49335088 (diff)
downloadbcm5719-llvm-160c9d81e07fec2d6299a9f31bb004f1b97419a6.tar.gz
bcm5719-llvm-160c9d81e07fec2d6299a9f31bb004f1b97419a6.zip
<rdar://problem/13700260>
<rdar://problem/13723772> Modified the lldb_private::Thread to work much better with the OperatingSystem plug-ins. Operating system plug-ins can now return have a "core" key/value pair in each thread dictionary for the OperatingSystemPython plug-ins which allows the core threads to be contained with memory threads. It also allows these memory threads to be stepped, resumed, and controlled just as if they were the actual backing threads themselves. A few things are introduced: - lldb_private::Thread now has a GetProtocolID() method which returns the thread protocol ID for a given thread. The protocol ID (Thread::GetProtocolID()) is usually the same as the thread id (Thread::GetID()), but it can differ when a memory thread has its own id, but is backed by an actual API thread. - Cleaned up the Thread::WillResume() code to do the mandatory parts in Thread::ShouldResume(), and let the thread subclasses override the Thread::WillResume() which is now just a notification. - Cleaned up ClearStackFrames() implementations so that fewer thread subclasses needed to override them - Changed the POSIXThread class a bit since it overrode Thread::WillResume(). It is doing the wrong thing by calling "Thread::SetResumeState()" on its own, this shouldn't be done by thread subclasses, but the current code might rely on it so I left it in with a TODO comment with an explanation. llvm-svn: 180886
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/ThreadMemory.h')
-rw-r--r--lldb/source/Plugins/Process/Utility/ThreadMemory.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/Utility/ThreadMemory.h b/lldb/source/Plugins/Process/Utility/ThreadMemory.h
index 51a2486f709..2a1f7d6b67d 100644
--- a/lldb/source/Plugins/Process/Utility/ThreadMemory.h
+++ b/lldb/source/Plugins/Process/Utility/ThreadMemory.h
@@ -70,7 +70,7 @@ public:
return NULL;
}
- virtual bool
+ virtual void
WillResume (lldb::StateType resume_state);
virtual void
@@ -79,6 +79,14 @@ public:
if (m_backing_thread_sp)
m_backing_thread_sp->DidResume();
}
+
+ virtual lldb::user_id_t
+ GetProtocolID () const
+ {
+ if (m_backing_thread_sp)
+ return m_backing_thread_sp->GetProtocolID();
+ return Thread::GetProtocolID();
+ }
virtual void
RefreshStateAfterStop();
@@ -90,6 +98,9 @@ public:
}
virtual void
+ ClearStackFrames ();
+
+ virtual void
ClearBackingThread ()
{
m_backing_thread_sp.reset();
@@ -98,6 +109,7 @@ public:
virtual bool
SetBackingThread (const lldb::ThreadSP &thread_sp)
{
+ //printf ("Thread 0x%llx is being backed by thread 0x%llx\n", GetID(), thread_sp->GetID());
m_backing_thread_sp = thread_sp;
return (bool)thread_sp;
}
@@ -109,6 +121,14 @@ public:
}
protected:
+
+ virtual bool
+ IsOperatingSystemPluginThread () const
+ {
+ return true;
+ }
+
+
//------------------------------------------------------------------
// For ThreadMemory and subclasses
//------------------------------------------------------------------
OpenPOWER on IntegriCloud