Greg Clayton | 643ee73 | 2010-08-04 01:40:35 +0000 | [diff] [blame] | 1 | //===-- StopInfoMachException.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_StopInfoMachException_h_ |
| 11 | #define liblldb_StopInfoMachException_h_ |
| 12 | |
| 13 | // C Includes |
| 14 | // C++ Includes |
| 15 | #include <string> |
| 16 | |
| 17 | // Other libraries and framework includes |
| 18 | // Project includes |
| 19 | #include "lldb/Target/StopInfo.h" |
| 20 | |
| 21 | namespace lldb_private { |
| 22 | |
| 23 | class StopInfoMachException : public StopInfo |
| 24 | { |
| 25 | public: |
| 26 | //------------------------------------------------------------------ |
| 27 | // Constructors and Destructors |
| 28 | //------------------------------------------------------------------ |
| 29 | StopInfoMachException (Thread &thread, |
| 30 | uint32_t exc_type, |
| 31 | uint32_t exc_data_count, |
| 32 | uint64_t exc_code, |
| 33 | uint64_t exc_subcode) : |
| 34 | StopInfo (thread, exc_type), |
| 35 | m_exc_data_count (exc_data_count), |
| 36 | m_exc_code (exc_code), |
| 37 | m_exc_subcode (exc_subcode) |
| 38 | { |
| 39 | } |
| 40 | |
| 41 | virtual ~StopInfoMachException() |
| 42 | { |
| 43 | } |
| 44 | |
| 45 | |
| 46 | virtual lldb::StopReason |
| 47 | GetStopReason () const |
| 48 | { |
| 49 | return lldb::eStopReasonException; |
| 50 | } |
| 51 | |
| 52 | virtual const char * |
| 53 | GetDescription (); |
| 54 | |
| 55 | // Since some mach exceptions will be reported as breakpoints, signals, |
| 56 | // or trace, we use this static accessor which will translate the mach |
| 57 | // exception into the correct StopInfo. |
| 58 | static lldb::StopInfoSP |
| 59 | CreateStopReasonWithMachException (Thread &thread, |
| 60 | uint32_t exc_type, |
| 61 | uint32_t exc_data_count, |
| 62 | uint64_t exc_code, |
| 63 | uint64_t exc_subcode); |
| 64 | |
| 65 | protected: |
| 66 | uint32_t m_exc_data_count; |
| 67 | uint64_t m_exc_code; |
| 68 | uint64_t m_exc_subcode; |
| 69 | std::string m_description; |
| 70 | }; |
| 71 | |
| 72 | |
| 73 | } // namespace lldb_private |
| 74 | |
| 75 | #endif // liblldb_StopInfoMachException_h_ |