blob: afa154805637a6e511f14c4f1d1e9043b2c90bd4 [file] [log] [blame]
Stephen Wilsonf6f40332010-07-24 02:19:04 +00001//===-- 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
21class ProcessMonitor;
22
23//------------------------------------------------------------------------------
24// @class LinuxThread
25// @brief Abstraction of a linux process (thread).
26class LinuxThread
27 : public lldb_private::Thread
28{
29public:
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
Stephen Wilsonf6f40332010-07-24 02:19:04 +000041 RegisterContextLinux *
42 GetRegisterContext();
43
44 bool
45 SaveFrameZeroState(RegisterCheckpoint &checkpoint);
46
47 bool
48 RestoreSaveFrameZero(const RegisterCheckpoint &checkpoint);
49
50 RegisterContextLinux *
51 CreateRegisterContextForFrame(lldb_private::StackFrame *frame);
52
Stephen Wilsonf6f40332010-07-24 02:19:04 +000053 //--------------------------------------------------------------------------
54 // These methods form a specialized interface to linux threads.
55 //
56 bool Resume();
57
58 void BreakNotify();
59 void TraceNotify();
60 void ExitNotify();
61
62private:
63 std::auto_ptr<lldb_private::StackFrame> m_frame_ap;
64 std::auto_ptr<RegisterContextLinux> m_register_ap;
65
66 lldb::BreakpointSiteSP m_breakpoint;
67
68 enum Notification {
69 eNone,
70 eBreak,
71 eTrace,
72 eExit
73 };
74
75 Notification m_note;
76
77 ProcessMonitor &GetMonitor();
Stephen Wilsoned560022011-01-04 21:45:02 +000078
79 lldb::StopInfoSP
80 GetPrivateStopReason();
Stephen Wilsonf6f40332010-07-24 02:19:04 +000081};
82
83#endif // #ifndef liblldb_LinuxThread_H_