Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame^] | 1 | //===-- 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 | /// |
| 26 | class POSIXStopInfo |
| 27 | : public lldb_private::StopInfo |
| 28 | { |
| 29 | public: |
| 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 | /// |
| 39 | class POSIXLimboStopInfo |
| 40 | : public POSIXStopInfo |
| 41 | { |
| 42 | public: |
| 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 | /// |
| 67 | class POSIXCrashStopInfo |
| 68 | : public POSIXStopInfo |
| 69 | { |
| 70 | public: |
| 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 | |
| 88 | private: |
| 89 | ProcessMessage::CrashReason m_crash_reason; |
| 90 | }; |
| 91 | |
| 92 | #endif |