| 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 |  | 
| Chaoren Lin | 28e5742 | 2015-02-03 01:51:25 +0000 | [diff] [blame] | 19 | #include "CrashReason.h" | 
| Ed Maste | fe5a642 | 2015-07-28 15:45:57 +0000 | [diff] [blame] | 20 | #include "FreeBSDThread.h" | 
| Chaoren Lin | 28e5742 | 2015-02-03 01:51:25 +0000 | [diff] [blame] | 21 |  | 
|  | 22 | #include <string> | 
| Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 23 |  | 
|  | 24 | //===----------------------------------------------------------------------===// | 
|  | 25 | /// @class POSIXStopInfo | 
|  | 26 | /// @brief Simple base class for all POSIX-specific StopInfo objects. | 
|  | 27 | /// | 
|  | 28 | class POSIXStopInfo | 
|  | 29 | : public lldb_private::StopInfo | 
|  | 30 | { | 
|  | 31 | public: | 
|  | 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 | /// | 
|  | 41 | class POSIXLimboStopInfo | 
|  | 42 | : public POSIXStopInfo | 
|  | 43 | { | 
|  | 44 | public: | 
| Ed Maste | fe5a642 | 2015-07-28 15:45:57 +0000 | [diff] [blame] | 45 | POSIXLimboStopInfo(FreeBSDThread &thread) | 
| Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 46 | : 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 | /// | 
|  | 69 | class POSIXCrashStopInfo | 
|  | 70 | : public POSIXStopInfo | 
|  | 71 | { | 
|  | 72 | public: | 
| Ed Maste | fe5a642 | 2015-07-28 15:45:57 +0000 | [diff] [blame] | 73 | POSIXCrashStopInfo(FreeBSDThread &thread, uint32_t status, | 
| Chaoren Lin | 28e5742 | 2015-02-03 01:51:25 +0000 | [diff] [blame] | 74 | CrashReason reason, | 
|  | 75 | lldb::addr_t fault_addr); | 
| Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 76 | ~POSIXCrashStopInfo(); | 
|  | 77 |  | 
|  | 78 | lldb::StopReason | 
|  | 79 | GetStopReason() const; | 
| Chaoren Lin | 28e5742 | 2015-02-03 01:51:25 +0000 | [diff] [blame] | 80 | }; | 
| Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 81 |  | 
| Matt Kopec | 650648f | 2013-01-08 16:30:18 +0000 | [diff] [blame] | 82 | //===----------------------------------------------------------------------===// | 
|  | 83 | /// @class POSIXNewThreadStopInfo | 
|  | 84 | /// @brief Represents the stop state of process when a new thread is spawned. | 
|  | 85 | /// | 
|  | 86 |  | 
|  | 87 | class POSIXNewThreadStopInfo | 
|  | 88 | : public POSIXStopInfo | 
|  | 89 | { | 
|  | 90 | public: | 
| Ed Maste | fe5a642 | 2015-07-28 15:45:57 +0000 | [diff] [blame] | 91 | POSIXNewThreadStopInfo (FreeBSDThread &thread) | 
| Matt Kopec | 650648f | 2013-01-08 16:30:18 +0000 | [diff] [blame] | 92 | : 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 Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 110 | #endif |