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_
13 #include "lldb/Target/Thread.h"
16 public lldb_private::Thread
20 ThreadMemory (lldb_private::Process &process,
22 const lldb::ValueObjectSP &thread_info_valobj_sp);
24 ThreadMemory (lldb_private::Process &process,
28 lldb::addr_t register_data_addr);
33 //------------------------------------------------------------------
34 // lldb_private::Thread methods
35 //------------------------------------------------------------------
36 virtual lldb::RegisterContextSP
37 GetRegisterContext ();
39 virtual lldb::RegisterContextSP
40 CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
48 if (m_backing_thread_sp)
49 m_backing_thread_sp->GetInfo();
57 return m_name.c_str();
58 if (m_backing_thread_sp)
59 m_backing_thread_sp->GetName();
67 return m_queue.c_str();
68 if (m_backing_thread_sp)
69 m_backing_thread_sp->GetQueueName();
74 WillResume (lldb::StateType resume_state);
79 if (m_backing_thread_sp)
80 m_backing_thread_sp->DidResume();
83 virtual lldb::user_id_t
84 GetProtocolID () const
86 if (m_backing_thread_sp)
87 return m_backing_thread_sp->GetProtocolID();
88 return Thread::GetProtocolID();
92 RefreshStateAfterStop();
97 return m_thread_info_valobj_sp;
104 ClearBackingThread ()
106 m_backing_thread_sp.reset();
110 SetBackingThread (const lldb::ThreadSP &thread_sp)
112 //printf ("Thread 0x%llx is being backed by thread 0x%llx\n", GetID(), thread_sp->GetID());
113 m_backing_thread_sp = thread_sp;
114 return (bool)thread_sp;
117 virtual lldb::ThreadSP
118 GetBackingThread () const
120 return m_backing_thread_sp;
126 IsOperatingSystemPluginThread () const
132 //------------------------------------------------------------------
133 // For ThreadMemory and subclasses
134 //------------------------------------------------------------------
135 // If this memory thread is actually represented by a thread from the
136 // lldb_private::Process subclass, then fill in the thread here and
137 // all APIs will be routed through this thread object. If m_backing_thread_sp
138 // is empty, then this thread is simply in memory with no representation
139 // through the process plug-in.
140 lldb::ThreadSP m_backing_thread_sp;
141 lldb::ValueObjectSP m_thread_info_valobj_sp;
144 lldb::addr_t m_register_data_addr;
146 //------------------------------------------------------------------
147 // For ThreadMemory only
148 //------------------------------------------------------------------
149 DISALLOW_COPY_AND_ASSIGN (ThreadMemory);
152 #endif // liblldb_ThreadMemory_h_