1 //===-- ThreadMemory.h ------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ThreadMemory_h_
11 #define liblldb_ThreadMemory_h_
17 // Other libraries and framework includes
19 #include "lldb/Target/Thread.h"
22 public lldb_private::Thread
25 ThreadMemory (lldb_private::Process &process,
27 const lldb::ValueObjectSP &thread_info_valobj_sp);
29 ThreadMemory (lldb_private::Process &process,
33 lldb::addr_t register_data_addr);
35 ~ThreadMemory() override;
37 lldb::RegisterContextSP
38 GetRegisterContext() override;
40 lldb::RegisterContextSP
41 CreateRegisterContextForFrame(lldb_private::StackFrame *frame) override;
44 CalculateStopInfo() override;
49 if (m_backing_thread_sp)
50 m_backing_thread_sp->GetInfo();
58 return m_name.c_str();
59 if (m_backing_thread_sp)
60 m_backing_thread_sp->GetName();
65 GetQueueName() override
68 return m_queue.c_str();
69 if (m_backing_thread_sp)
70 m_backing_thread_sp->GetQueueName();
75 WillResume(lldb::StateType resume_state) override;
80 if (m_backing_thread_sp)
81 m_backing_thread_sp->DidResume();
85 GetProtocolID() const override
87 if (m_backing_thread_sp)
88 return m_backing_thread_sp->GetProtocolID();
89 return Thread::GetProtocolID();
93 RefreshStateAfterStop() override;
98 return m_thread_info_valobj_sp;
102 ClearStackFrames() override;
105 ClearBackingThread() override
107 m_backing_thread_sp.reset();
111 SetBackingThread(const lldb::ThreadSP &thread_sp) override
113 //printf ("Thread 0x%llx is being backed by thread 0x%llx\n", GetID(), thread_sp->GetID());
114 m_backing_thread_sp = thread_sp;
115 return (bool)thread_sp;
119 GetBackingThread() const override
121 return m_backing_thread_sp;
126 IsOperatingSystemPluginThread() const override
131 // If this memory thread is actually represented by a thread from the
132 // lldb_private::Process subclass, then fill in the thread here and
133 // all APIs will be routed through this thread object. If m_backing_thread_sp
134 // is empty, then this thread is simply in memory with no representation
135 // through the process plug-in.
136 lldb::ThreadSP m_backing_thread_sp;
137 lldb::ValueObjectSP m_thread_info_valobj_sp;
140 lldb::addr_t m_register_data_addr;
143 DISALLOW_COPY_AND_ASSIGN (ThreadMemory);
146 #endif // liblldb_ThreadMemory_h_