Stephen Wilson | f6f4033 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 1 | //===-- LinuxThread.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_LinuxThread_H_ |
| 11 | #define liblldb_LinuxThread_H_ |
| 12 | |
| 13 | // C Includes |
| 14 | // C++ Includes |
| 15 | #include <memory> |
| 16 | |
| 17 | // Other libraries and framework includes |
| 18 | #include "lldb/Target/Thread.h" |
Stephen Wilson | f6f4033 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 19 | |
Stephen Wilson | 67d9f7e | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 20 | class ProcessMessage; |
Stephen Wilson | f6f4033 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 21 | class ProcessMonitor; |
Greg Clayton | 90ccf88 | 2011-01-06 22:35:55 +0000 | [diff] [blame] | 22 | class RegisterContextLinux; |
Stephen Wilson | f6f4033 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 23 | |
| 24 | //------------------------------------------------------------------------------ |
| 25 | // @class LinuxThread |
| 26 | // @brief Abstraction of a linux process (thread). |
| 27 | class LinuxThread |
| 28 | : public lldb_private::Thread |
| 29 | { |
| 30 | public: |
| 31 | LinuxThread(lldb_private::Process &process, lldb::tid_t tid); |
| 32 | |
Stephen Wilson | b47794a | 2011-01-16 16:56:16 +0000 | [diff] [blame] | 33 | virtual ~LinuxThread(); |
| 34 | |
Stephen Wilson | f6f4033 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 35 | void |
| 36 | RefreshStateAfterStop(); |
| 37 | |
| 38 | bool |
| 39 | WillResume(lldb::StateType resume_state); |
| 40 | |
| 41 | const char * |
| 42 | GetInfo(); |
| 43 | |
Greg Clayton | 90ccf88 | 2011-01-06 22:35:55 +0000 | [diff] [blame] | 44 | virtual lldb::RegisterContextSP |
Stephen Wilson | f6f4033 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 45 | GetRegisterContext(); |
| 46 | |
Greg Clayton | 90ccf88 | 2011-01-06 22:35:55 +0000 | [diff] [blame] | 47 | virtual lldb::RegisterContextSP |
Stephen Wilson | bc1418b | 2011-01-07 00:10:43 +0000 | [diff] [blame] | 48 | CreateRegisterContextForFrame (lldb_private::StackFrame *frame); |
Stephen Wilson | f6f4033 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 49 | |
Stephen Wilson | f6f4033 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 50 | //-------------------------------------------------------------------------- |
| 51 | // These methods form a specialized interface to linux threads. |
| 52 | // |
| 53 | bool Resume(); |
| 54 | |
Stephen Wilson | 67d9f7e | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 55 | void Notify(const ProcessMessage &message); |
Stephen Wilson | f6f4033 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 56 | |
| 57 | private: |
Greg Clayton | 90ccf88 | 2011-01-06 22:35:55 +0000 | [diff] [blame] | 58 | RegisterContextLinux * |
| 59 | GetRegisterContextLinux () |
| 60 | { |
| 61 | if (!m_reg_context_sp) |
| 62 | GetRegisterContext(); |
Stephen Wilson | bc1418b | 2011-01-07 00:10:43 +0000 | [diff] [blame] | 63 | return (RegisterContextLinux *)m_reg_context_sp.get(); |
Greg Clayton | 90ccf88 | 2011-01-06 22:35:55 +0000 | [diff] [blame] | 64 | } |
| 65 | |
Stephen Wilson | f6f4033 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 66 | std::auto_ptr<lldb_private::StackFrame> m_frame_ap; |
Stephen Wilson | f6f4033 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 67 | |
| 68 | lldb::BreakpointSiteSP m_breakpoint; |
Stephen Wilson | 140f69a | 2011-01-15 00:07:36 +0000 | [diff] [blame] | 69 | lldb::StopInfoSP m_stop_info; |
| 70 | |
Stephen Wilson | 67d9f7e | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 71 | ProcessMonitor & |
| 72 | GetMonitor(); |
Stephen Wilson | ed56002 | 2011-01-04 21:45:02 +0000 | [diff] [blame] | 73 | |
| 74 | lldb::StopInfoSP |
| 75 | GetPrivateStopReason(); |
Stephen Wilson | d61182d | 2011-01-04 21:45:57 +0000 | [diff] [blame] | 76 | |
Stephen Wilson | 67d9f7e | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 77 | void BreakNotify(const ProcessMessage &message); |
| 78 | void TraceNotify(const ProcessMessage &message); |
| 79 | void LimboNotify(const ProcessMessage &message); |
| 80 | void SignalNotify(const ProcessMessage &message); |
| 81 | void SignalDeliveredNotify(const ProcessMessage &message); |
| 82 | void CrashNotify(const ProcessMessage &message); |
Stephen Wilson | 140f69a | 2011-01-15 00:07:36 +0000 | [diff] [blame] | 83 | |
Stephen Wilson | d61182d | 2011-01-04 21:45:57 +0000 | [diff] [blame] | 84 | lldb_private::Unwind * |
| 85 | GetUnwinder(); |
Stephen Wilson | f6f4033 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 86 | }; |
| 87 | |
| 88 | #endif // #ifndef liblldb_LinuxThread_H_ |