summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility/ThreadMemory.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-04-12 20:07:46 +0000
committerGreg Clayton <gclayton@apple.com>2013-04-12 20:07:46 +0000
commitb3ae87617437c5850003cd7ab35e0b3581d2b7da (patch)
tree432a368c3ea470e6bb546276e059f19aa3c491dc /lldb/source/Plugins/Process/Utility/ThreadMemory.cpp
parent7181ed33461e3ee0a3fd4d9f8ec16b708d34ab2f (diff)
downloadbcm5719-llvm-b3ae87617437c5850003cd7ab35e0b3581d2b7da.tar.gz
bcm5719-llvm-b3ae87617437c5850003cd7ab35e0b3581d2b7da.zip
<rdar://problem/13491977>
Made some fixes to the OperatingSystemPython class: - If any thread dictionary contains any "core=N" key/value pairs then the threads obtained from the lldb_private::Process itself will be placed inside the ThreadMemory threads and will be used to get the information for a thread. - Cleaned up all the places where a thread inside a thread was causing problems llvm-svn: 179405
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/ThreadMemory.cpp')
-rw-r--r--lldb/source/Plugins/Process/Utility/ThreadMemory.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/Utility/ThreadMemory.cpp b/lldb/source/Plugins/Process/Utility/ThreadMemory.cpp
index 7ab5db73fcd..e7602b89020 100644
--- a/lldb/source/Plugins/Process/Utility/ThreadMemory.cpp
+++ b/lldb/source/Plugins/Process/Utility/ThreadMemory.cpp
@@ -21,6 +21,7 @@ ThreadMemory::ThreadMemory (Process &process,
tid_t tid,
const ValueObjectSP &thread_info_valobj_sp) :
Thread (process, tid),
+ m_backing_thread_sp (),
m_thread_info_valobj_sp (thread_info_valobj_sp),
m_name(),
m_queue()
@@ -34,6 +35,7 @@ ThreadMemory::ThreadMemory (Process &process,
const char *queue,
lldb::addr_t register_data_addr) :
Thread (process, tid),
+ m_backing_thread_sp (),
m_thread_info_valobj_sp (),
m_name(),
m_queue(),
@@ -65,6 +67,9 @@ ThreadMemory::WillResume (StateType resume_state)
RegisterContextSP
ThreadMemory::GetRegisterContext ()
{
+ if (m_backing_thread_sp)
+ return m_backing_thread_sp->GetRegisterContext();
+
if (!m_reg_context_sp)
{
ProcessSP process_sp (GetProcess());
@@ -81,6 +86,9 @@ ThreadMemory::GetRegisterContext ()
RegisterContextSP
ThreadMemory::CreateRegisterContextForFrame (StackFrame *frame)
{
+ if (m_backing_thread_sp)
+ return m_backing_thread_sp->CreateRegisterContextForFrame(frame);
+
RegisterContextSP reg_ctx_sp;
uint32_t concrete_frame_idx = 0;
@@ -91,9 +99,11 @@ ThreadMemory::CreateRegisterContextForFrame (StackFrame *frame)
{
reg_ctx_sp = GetRegisterContext ();
}
- else if (m_unwinder_ap.get())
+ else
{
- reg_ctx_sp = m_unwinder_ap->CreateRegisterContextForFrame (frame);
+ Unwind *unwinder = GetUnwinder ();
+ if (unwinder)
+ reg_ctx_sp = unwinder->CreateRegisterContextForFrame (frame);
}
return reg_ctx_sp;
}
@@ -101,6 +111,9 @@ ThreadMemory::CreateRegisterContextForFrame (StackFrame *frame)
lldb::StopInfoSP
ThreadMemory::GetPrivateStopReason ()
{
+ if (m_backing_thread_sp)
+ return m_backing_thread_sp->GetPrivateStopReason();
+
ProcessSP process_sp (GetProcess());
if (process_sp)
@@ -135,6 +148,10 @@ ThreadMemory::GetPrivateStopReason ()
void
ThreadMemory::RefreshStateAfterStop()
{
+ if (m_backing_thread_sp)
+ return m_backing_thread_sp->RefreshStateAfterStop();
+
+
// Don't fetch the registers by calling Thread::GetRegisterContext() below.
// We might not have fetched any registers yet and we don't want to fetch
// the registers just to call invalidate on them...
OpenPOWER on IntegriCloud