blob: ace6c98017b776f13d3b30f107d354d2b00213d8 [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
Chaoren Lin28e57422015-02-03 01:51:25 +000019#include "CrashReason.h"
Ed Mastefe5a6422015-07-28 15:45:57 +000020#include "FreeBSDThread.h"
Chaoren Lin28e57422015-02-03 01:51:25 +000021
22#include <string>
Johnny Chen9ed5b492012-01-05 21:48:15 +000023
24//===----------------------------------------------------------------------===//
25/// @class POSIXStopInfo
26/// @brief Simple base class for all POSIX-specific StopInfo objects.
27///
28class POSIXStopInfo
29 : public lldb_private::StopInfo
30{
31public:
32 POSIXStopInfo(lldb_private::Thread &thread, uint32_t status)
33 : StopInfo(thread, status)
34 { }
35};
36
37//===----------------------------------------------------------------------===//
38/// @class POSIXLimboStopInfo
39/// @brief Represents the stop state of a process ready to exit.
40///
41class POSIXLimboStopInfo
42 : public POSIXStopInfo
43{
44public:
Ed Mastefe5a6422015-07-28 15:45:57 +000045 POSIXLimboStopInfo(FreeBSDThread &thread)
Johnny Chen9ed5b492012-01-05 21:48:15 +000046 : POSIXStopInfo(thread, 0)
47 { }
48
49 ~POSIXLimboStopInfo();
50
51 lldb::StopReason
52 GetStopReason() const;
53
54 const char *
55 GetDescription();
56
57 bool
58 ShouldStop(lldb_private::Event *event_ptr);
59
60 bool
61 ShouldNotify(lldb_private::Event *event_ptr);
62};
63
64
65//===----------------------------------------------------------------------===//
66/// @class POSIXCrashStopInfo
67/// @brief Represents the stop state of process that is ready to crash.
68///
69class POSIXCrashStopInfo
70 : public POSIXStopInfo
71{
72public:
Ed Mastefe5a6422015-07-28 15:45:57 +000073 POSIXCrashStopInfo(FreeBSDThread &thread, uint32_t status,
Chaoren Lin28e57422015-02-03 01:51:25 +000074 CrashReason reason,
75 lldb::addr_t fault_addr);
Johnny Chen9ed5b492012-01-05 21:48:15 +000076 ~POSIXCrashStopInfo();
77
78 lldb::StopReason
79 GetStopReason() const;
Chaoren Lin28e57422015-02-03 01:51:25 +000080};
Johnny Chen9ed5b492012-01-05 21:48:15 +000081
Matt Kopec650648f2013-01-08 16:30:18 +000082//===----------------------------------------------------------------------===//
83/// @class POSIXNewThreadStopInfo
84/// @brief Represents the stop state of process when a new thread is spawned.
85///
86
87class POSIXNewThreadStopInfo
88 : public POSIXStopInfo
89{
90public:
Ed Mastefe5a6422015-07-28 15:45:57 +000091 POSIXNewThreadStopInfo (FreeBSDThread &thread)
Matt Kopec650648f2013-01-08 16:30:18 +000092 : POSIXStopInfo (thread, 0)
93 { }
94
95 ~POSIXNewThreadStopInfo();
96
97 lldb::StopReason
98 GetStopReason() const;
99
100 const char *
101 GetDescription();
102
103 bool
104 ShouldStop(lldb_private::Event *event_ptr);
105
106 bool
107 ShouldNotify(lldb_private::Event *event_ptr);
108};
109
Johnny Chen9ed5b492012-01-05 21:48:15 +0000110#endif