blob: 7c5be3dc6150cff5e3f35e0b908b02452c35de3e [file] [log] [blame]
Johnny Chen9ed5b492012-01-05 21:48:15 +00001//===-- POSIXStopInfo.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_POSIXStopInfo_H_
11#define liblldb_POSIXStopInfo_H_
12
13// C Includes
14// C++ Includes
15// Other libraries and framework includes
16// Project includes
17#include "lldb/Target/StopInfo.h"
18
19#include "POSIXThread.h"
20#include "ProcessMessage.h"
21
22//===----------------------------------------------------------------------===//
23/// @class POSIXStopInfo
24/// @brief Simple base class for all POSIX-specific StopInfo objects.
25///
26class POSIXStopInfo
27 : public lldb_private::StopInfo
28{
29public:
30 POSIXStopInfo(lldb_private::Thread &thread, uint32_t status)
31 : StopInfo(thread, status)
32 { }
33};
34
35//===----------------------------------------------------------------------===//
36/// @class POSIXLimboStopInfo
37/// @brief Represents the stop state of a process ready to exit.
38///
39class POSIXLimboStopInfo
40 : public POSIXStopInfo
41{
42public:
43 POSIXLimboStopInfo(POSIXThread &thread)
44 : POSIXStopInfo(thread, 0)
45 { }
46
47 ~POSIXLimboStopInfo();
48
49 lldb::StopReason
50 GetStopReason() const;
51
52 const char *
53 GetDescription();
54
55 bool
56 ShouldStop(lldb_private::Event *event_ptr);
57
58 bool
59 ShouldNotify(lldb_private::Event *event_ptr);
60};
61
62
63//===----------------------------------------------------------------------===//
64/// @class POSIXCrashStopInfo
65/// @brief Represents the stop state of process that is ready to crash.
66///
67class POSIXCrashStopInfo
68 : public POSIXStopInfo
69{
70public:
71 POSIXCrashStopInfo(POSIXThread &thread, uint32_t status,
72 ProcessMessage::CrashReason reason)
73 : POSIXStopInfo(thread, status),
74 m_crash_reason(reason)
75 { }
76
77 ~POSIXCrashStopInfo();
78
79 lldb::StopReason
80 GetStopReason() const;
81
82 const char *
83 GetDescription();
84
85 ProcessMessage::CrashReason
86 GetCrashReason() const;
87
88private:
89 ProcessMessage::CrashReason m_crash_reason;
90};
91
Matt Kopec650648f2013-01-08 16:30:18 +000092//===----------------------------------------------------------------------===//
93/// @class POSIXNewThreadStopInfo
94/// @brief Represents the stop state of process when a new thread is spawned.
95///
96
97class POSIXNewThreadStopInfo
98 : public POSIXStopInfo
99{
100public:
101 POSIXNewThreadStopInfo (POSIXThread &thread)
102 : POSIXStopInfo (thread, 0)
103 { }
104
105 ~POSIXNewThreadStopInfo();
106
107 lldb::StopReason
108 GetStopReason() const;
109
110 const char *
111 GetDescription();
112
113 bool
114 ShouldStop(lldb_private::Event *event_ptr);
115
116 bool
117 ShouldNotify(lldb_private::Event *event_ptr);
118};
119
Johnny Chen9ed5b492012-01-05 21:48:15 +0000120#endif