blob: 97f5f8a988e4045e5da6043c8613c3c5e43b3ba8 [file] [log] [blame]
Greg Clayton0fa51242011-07-19 03:57:15 +00001//===-- ThreadKDP.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_ThreadKDP_h_
11#define liblldb_ThreadKDP_h_
12
13#include <string>
14
15#include "lldb/Target/Process.h"
16#include "lldb/Target/Thread.h"
17
18class ProcessKDP;
19
20class ThreadKDP : public lldb_private::Thread
21{
22public:
Greg Claytonf4124de2012-02-21 00:09:25 +000023 ThreadKDP (const lldb::ProcessSP &process_sp,
Greg Clayton0fa51242011-07-19 03:57:15 +000024 lldb::tid_t tid);
25
26 virtual
27 ~ThreadKDP ();
28
29 virtual bool
30 WillResume (lldb::StateType resume_state);
31
32 virtual void
33 RefreshStateAfterStop();
34
35 virtual const char *
Greg Clayton0fa51242011-07-19 03:57:15 +000036 GetName ();
37
38 virtual const char *
39 GetQueueName ();
40
41 virtual lldb::RegisterContextSP
42 GetRegisterContext ();
43
44 virtual lldb::RegisterContextSP
45 CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
46
47 virtual void
48 ClearStackFrames ();
49
Greg Clayton0fa51242011-07-19 03:57:15 +000050 void
51 Dump (lldb_private::Log *log, uint32_t index);
52
53 static bool
54 ThreadIDIsValid (lldb::tid_t thread);
55
56 bool
57 ShouldStop (bool &step_more);
58
59 const char *
60 GetBasicInfoAsString ();
61
62 void
63 SetName (const char *name)
64 {
65 if (name && name[0])
66 m_thread_name.assign (name);
67 else
68 m_thread_name.clear();
69 }
70
71 lldb::addr_t
72 GetThreadDispatchQAddr ()
73 {
74 return m_thread_dispatch_qaddr;
75 }
76
77 void
78 SetThreadDispatchQAddr (lldb::addr_t thread_dispatch_qaddr)
79 {
80 m_thread_dispatch_qaddr = thread_dispatch_qaddr;
81 }
Greg Clayton3acaa922012-09-25 02:40:06 +000082
83 void
84 SetStopInfoFrom_KDP_EXCEPTION (const lldb_private::DataExtractor &exc_reply_packet);
Greg Clayton0fa51242011-07-19 03:57:15 +000085
86protected:
87
88 friend class ProcessKDP;
89
90 //------------------------------------------------------------------
91 // Member variables.
92 //------------------------------------------------------------------
93 std::string m_thread_name;
94 std::string m_dispatch_queue_name;
95 lldb::addr_t m_thread_dispatch_qaddr;
Greg Clayton3acaa922012-09-25 02:40:06 +000096 lldb::StopInfoSP m_cached_stop_info_sp;
Greg Clayton0fa51242011-07-19 03:57:15 +000097 //------------------------------------------------------------------
98 // Member variables.
99 //------------------------------------------------------------------
100
Greg Clayton0fa51242011-07-19 03:57:15 +0000101 virtual lldb::StopInfoSP
102 GetPrivateStopReason ();
103
104
105};
106
107#endif // liblldb_ThreadKDP_h_