1 //===-- POSIXThread.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_POSIXThread_H_
11 #define liblldb_POSIXThread_H_
18 // Other libraries and framework includes
19 #include "lldb/Target/Thread.h"
20 #include "RegisterContextPOSIX.h"
24 class POSIXBreakpointProtocol;
26 //------------------------------------------------------------------------------
28 // @brief Abstraction of a POSIX thread.
30 : public lldb_private::Thread
33 POSIXThread(lldb_private::Process &process, lldb::tid_t tid);
35 virtual ~POSIXThread();
38 RefreshStateAfterStop();
41 WillResume(lldb::StateType resume_state);
43 // This notifies the thread when a private stop occurs.
51 SetName (const char *name);
56 virtual lldb::RegisterContextSP
59 virtual lldb::RegisterContextSP
60 CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
65 //--------------------------------------------------------------------------
66 // These functions provide a mapping from the register offset
67 // back to the register index or name for use in debugging or log
71 GetRegisterIndexFromOffset(unsigned offset);
74 GetRegisterName(unsigned reg);
77 GetRegisterNameFromOffset(unsigned offset);
79 //--------------------------------------------------------------------------
80 // These methods form a specialized interface to POSIX threads.
84 void Notify(const ProcessMessage &message);
86 //--------------------------------------------------------------------------
87 // These methods provide an interface to watchpoints
89 bool EnableHardwareWatchpoint(lldb_private::Watchpoint *wp);
91 bool DisableHardwareWatchpoint(lldb_private::Watchpoint *wp);
93 uint32_t NumSupportedHardwareWatchpoints();
95 uint32_t FindVacantWatchpointIndex();
98 POSIXBreakpointProtocol *
99 GetPOSIXBreakpointProtocol ()
101 if (!m_reg_context_sp)
102 m_reg_context_sp = GetRegisterContext();
103 return m_posix_thread;
106 std::unique_ptr<lldb_private::StackFrame> m_frame_ap;
108 lldb::BreakpointSiteSP m_breakpoint;
110 bool m_thread_name_valid;
111 std::string m_thread_name;
112 POSIXBreakpointProtocol *m_posix_thread;
120 void BreakNotify(const ProcessMessage &message);
121 void WatchNotify(const ProcessMessage &message);
122 virtual void TraceNotify(const ProcessMessage &message);
123 void LimboNotify(const ProcessMessage &message);
124 void SignalNotify(const ProcessMessage &message);
125 void SignalDeliveredNotify(const ProcessMessage &message);
126 void CrashNotify(const ProcessMessage &message);
127 void ThreadNotify(const ProcessMessage &message);
128 void ExitNotify(const ProcessMessage &message);
129 void ExecNotify(const ProcessMessage &message);
131 lldb_private::Unwind *
135 #endif // #ifndef liblldb_POSIXThread_H_