1254721Semaste//===-- POSIXStopInfo.h -----------------------------------------*- C++ -*-===//
2254721Semaste//
3254721Semaste//                     The LLVM Compiler Infrastructure
4254721Semaste//
5254721Semaste// This file is distributed under the University of Illinois Open Source
6254721Semaste// License. See LICENSE.TXT for details.
7254721Semaste//
8254721Semaste//===----------------------------------------------------------------------===//
9254721Semaste
10254721Semaste#ifndef liblldb_POSIXStopInfo_H_
11254721Semaste#define liblldb_POSIXStopInfo_H_
12254721Semaste
13254721Semaste// C Includes
14254721Semaste// C++ Includes
15254721Semaste// Other libraries and framework includes
16254721Semaste// Project includes
17254721Semaste#include "lldb/Target/StopInfo.h"
18254721Semaste
19254721Semaste#include "POSIXThread.h"
20254721Semaste#include "ProcessMessage.h"
21254721Semaste
22254721Semaste//===----------------------------------------------------------------------===//
23254721Semaste/// @class POSIXStopInfo
24254721Semaste/// @brief Simple base class for all POSIX-specific StopInfo objects.
25254721Semaste///
26254721Semasteclass POSIXStopInfo
27254721Semaste    : public lldb_private::StopInfo
28254721Semaste{
29254721Semastepublic:
30254721Semaste    POSIXStopInfo(lldb_private::Thread &thread, uint32_t status)
31254721Semaste        : StopInfo(thread, status)
32254721Semaste        { }
33254721Semaste};
34254721Semaste
35254721Semaste//===----------------------------------------------------------------------===//
36254721Semaste/// @class POSIXLimboStopInfo
37254721Semaste/// @brief Represents the stop state of a process ready to exit.
38254721Semaste///
39254721Semasteclass POSIXLimboStopInfo
40254721Semaste    : public POSIXStopInfo
41254721Semaste{
42254721Semastepublic:
43254721Semaste    POSIXLimboStopInfo(POSIXThread &thread)
44254721Semaste        : POSIXStopInfo(thread, 0)
45254721Semaste        { }
46254721Semaste
47254721Semaste    ~POSIXLimboStopInfo();
48254721Semaste
49254721Semaste    lldb::StopReason
50254721Semaste    GetStopReason() const;
51254721Semaste
52254721Semaste    const char *
53254721Semaste    GetDescription();
54254721Semaste
55254721Semaste    bool
56254721Semaste    ShouldStop(lldb_private::Event *event_ptr);
57254721Semaste
58254721Semaste    bool
59254721Semaste    ShouldNotify(lldb_private::Event *event_ptr);
60254721Semaste};
61254721Semaste
62254721Semaste
63254721Semaste//===----------------------------------------------------------------------===//
64254721Semaste/// @class POSIXCrashStopInfo
65254721Semaste/// @brief Represents the stop state of process that is ready to crash.
66254721Semaste///
67254721Semasteclass POSIXCrashStopInfo
68254721Semaste    : public POSIXStopInfo
69254721Semaste{
70254721Semastepublic:
71254721Semaste    POSIXCrashStopInfo(POSIXThread &thread, uint32_t status,
72254721Semaste                       ProcessMessage::CrashReason reason,
73254721Semaste                       lldb::addr_t fault_addr)
74254721Semaste        : POSIXStopInfo(thread, status),
75254721Semaste          m_crash_reason(reason),
76254721Semaste          m_fault_addr(fault_addr)
77254721Semaste        { }
78254721Semaste
79254721Semaste    ~POSIXCrashStopInfo();
80254721Semaste
81254721Semaste    lldb::StopReason
82254721Semaste    GetStopReason() const;
83254721Semaste
84254721Semaste    const char *
85254721Semaste    GetDescription();
86254721Semaste
87254721Semasteprivate:
88254721Semaste    ProcessMessage::CrashReason m_crash_reason;
89254721Semaste    lldb::addr_t m_fault_addr;
90254721Semaste};
91254721Semaste
92254721Semaste//===----------------------------------------------------------------------===//
93254721Semaste/// @class POSIXNewThreadStopInfo
94254721Semaste/// @brief Represents the stop state of process when a new thread is spawned.
95254721Semaste///
96254721Semaste
97254721Semasteclass POSIXNewThreadStopInfo
98254721Semaste    : public POSIXStopInfo
99254721Semaste{
100254721Semastepublic:
101254721Semaste    POSIXNewThreadStopInfo (POSIXThread &thread)
102254721Semaste        : POSIXStopInfo (thread, 0)
103254721Semaste        { }
104254721Semaste
105254721Semaste    ~POSIXNewThreadStopInfo();
106254721Semaste
107254721Semaste    lldb::StopReason
108254721Semaste    GetStopReason() const;
109254721Semaste
110254721Semaste    const char *
111254721Semaste    GetDescription();
112254721Semaste
113254721Semaste    bool
114254721Semaste    ShouldStop(lldb_private::Event *event_ptr);
115254721Semaste
116254721Semaste    bool
117254721Semaste    ShouldNotify(lldb_private::Event *event_ptr);
118254721Semaste};
119254721Semaste
120254721Semaste#endif
121