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" |
| 19 | #include "RegisterContextLinux.h" |
| 20 | |
| 21 | class ProcessMonitor; |
| 22 | |
| 23 | //------------------------------------------------------------------------------ |
| 24 | // @class LinuxThread |
| 25 | // @brief Abstraction of a linux process (thread). |
| 26 | class LinuxThread |
| 27 | : public lldb_private::Thread |
| 28 | { |
| 29 | public: |
| 30 | LinuxThread(lldb_private::Process &process, lldb::tid_t tid); |
| 31 | |
| 32 | void |
| 33 | RefreshStateAfterStop(); |
| 34 | |
| 35 | bool |
| 36 | WillResume(lldb::StateType resume_state); |
| 37 | |
| 38 | const char * |
| 39 | GetInfo(); |
| 40 | |
| 41 | uint32_t |
| 42 | GetStackFrameCount(); |
| 43 | |
| 44 | lldb::StackFrameSP |
| 45 | GetStackFrameAtIndex(uint32_t idx); |
| 46 | |
| 47 | RegisterContextLinux * |
| 48 | GetRegisterContext(); |
| 49 | |
| 50 | bool |
| 51 | SaveFrameZeroState(RegisterCheckpoint &checkpoint); |
| 52 | |
| 53 | bool |
| 54 | RestoreSaveFrameZero(const RegisterCheckpoint &checkpoint); |
| 55 | |
| 56 | RegisterContextLinux * |
| 57 | CreateRegisterContextForFrame(lldb_private::StackFrame *frame); |
| 58 | |
| 59 | bool |
| 60 | GetRawStopReason(StopInfo *stop_info); |
| 61 | |
| 62 | //-------------------------------------------------------------------------- |
| 63 | // These methods form a specialized interface to linux threads. |
| 64 | // |
| 65 | bool Resume(); |
| 66 | |
| 67 | void BreakNotify(); |
| 68 | void TraceNotify(); |
| 69 | void ExitNotify(); |
| 70 | |
| 71 | private: |
| 72 | std::auto_ptr<lldb_private::StackFrame> m_frame_ap; |
| 73 | std::auto_ptr<RegisterContextLinux> m_register_ap; |
| 74 | |
| 75 | lldb::BreakpointSiteSP m_breakpoint; |
| 76 | |
| 77 | enum Notification { |
| 78 | eNone, |
| 79 | eBreak, |
| 80 | eTrace, |
| 81 | eExit |
| 82 | }; |
| 83 | |
| 84 | Notification m_note; |
| 85 | |
| 86 | ProcessMonitor &GetMonitor(); |
| 87 | }; |
| 88 | |
| 89 | #endif // #ifndef liblldb_LinuxThread_H_ |