1 //===-- ThreadMemory.h -----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef liblldb_ThreadMemory_h_
11 #define liblldb_ThreadMemory_h_
12 
13 #include "lldb/Target/Thread.h"
14 
15 class ThreadMemory :
16     public lldb_private::Thread
17 {
18 public:
19 
20     ThreadMemory (lldb_private::Process &process,
21                   lldb::tid_t tid,
22                   const lldb::ValueObjectSP &thread_info_valobj_sp);
23 
24     ThreadMemory (lldb_private::Process &process,
25                   lldb::tid_t tid,
26                   const char *name,
27                   const char *queue,
28                   lldb::addr_t register_data_addr);
29 
30     virtual
31     ~ThreadMemory();
32 
33     //------------------------------------------------------------------
34     // lldb_private::Thread methods
35     //------------------------------------------------------------------
36     virtual void
37     RefreshStateAfterStop();
38 
39     virtual lldb::RegisterContextSP
40     GetRegisterContext ();
41 
42     virtual lldb::RegisterContextSP
43     CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
44 
45     virtual lldb::StopInfoSP
46     GetPrivateStopReason ();
47 
48     virtual const char *
49     GetName ()
50     {
51         return m_name.c_str();
52     }
53 
54     virtual const char *
55     GetQueueName ()
56     {
57         return m_queue.c_str();
58     }
59 
60     virtual bool
61     WillResume (lldb::StateType resume_state);
62 
63     lldb::ValueObjectSP &
64     GetValueObject ()
65     {
66         return m_thread_info_valobj_sp;
67     }
68 
69 protected:
70     //------------------------------------------------------------------
71     // For ThreadMemory and subclasses
72     //------------------------------------------------------------------
73     lldb::ValueObjectSP m_thread_info_valobj_sp;
74     std::string m_name;
75     std::string m_queue;
76     lldb::addr_t m_register_data_addr;
77 private:
78     //------------------------------------------------------------------
79     // For ThreadMemory only
80     //------------------------------------------------------------------
81     DISALLOW_COPY_AND_ASSIGN (ThreadMemory);
82 };
83 
84 #endif  // liblldb_ThreadMemory_h_
85