blob: 25e05ecc1ec72958c07a49f910f50353b1fb7242 [file] [log] [blame]
Greg Claytonf4b47e12010-08-04 01:40:35 +00001//===-- 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
21namespace lldb_private {
22
23class StopInfoMachException : public StopInfo
24{
25public:
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
Eugene Zelenkoab7f6d02015-10-21 18:46:17 +000041 ~StopInfoMachException() override = default;
Greg Claytonf4b47e12010-08-04 01:40:35 +000042
Eugene Zelenkoab7f6d02015-10-21 18:46:17 +000043 lldb::StopReason
44 GetStopReason() const override
Greg Claytonf4b47e12010-08-04 01:40:35 +000045 {
46 return lldb::eStopReasonException;
47 }
48
Eugene Zelenkoab7f6d02015-10-21 18:46:17 +000049 const char *
50 GetDescription() override;
Greg Claytonf4b47e12010-08-04 01:40:35 +000051
52 // Since some mach exceptions will be reported as breakpoints, signals,
53 // or trace, we use this static accessor which will translate the mach
54 // exception into the correct StopInfo.
55 static lldb::StopInfoSP
56 CreateStopReasonWithMachException (Thread &thread,
57 uint32_t exc_type,
58 uint32_t exc_data_count,
59 uint64_t exc_code,
Johnny Chen236888d2011-09-17 01:05:03 +000060 uint64_t exc_sub_code,
Greg Clayton97d5cf02012-09-25 02:40:06 +000061 uint64_t exc_sub_sub_code,
62 bool pc_already_adjusted = true,
63 bool adjust_pc_if_needed = false);
64
Greg Claytonf4b47e12010-08-04 01:40:35 +000065protected:
66 uint32_t m_exc_data_count;
67 uint64_t m_exc_code;
68 uint64_t m_exc_subcode;
Greg Claytonf4b47e12010-08-04 01:40:35 +000069};
70
Greg Claytonf4b47e12010-08-04 01:40:35 +000071} // namespace lldb_private
72
Eugene Zelenkoab7f6d02015-10-21 18:46:17 +000073#endif // liblldb_StopInfoMachException_h_