[RISCV] Add RVVConstraint to SiFive custom matrix multiply instructions. (#124055)
[llvm-project.git] / lldb / source / Plugins / Process / Utility / StopInfoMachException.h
blobc612ac400b4c4ca07c0f1a7cbea2d9ad77396c3c
1 //===-- StopInfoMachException.h ---------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_STOPINFOMACHEXCEPTION_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_STOPINFOMACHEXCEPTION_H
12 #include <optional>
13 #include <string>
15 #include "lldb/Target/StopInfo.h"
17 #if defined(__APPLE__)
18 // Needed for the EXC_* defines
19 #include <mach/exception.h>
20 #endif
22 namespace lldb_private {
24 class StopInfoMachException : public StopInfo {
25 /// Determine the pointer-authentication related failure that caused this
26 /// exception. Returns true and fills out the failure description if there
27 /// is auth-related failure, and returns false otherwise.
28 bool DeterminePtrauthFailure(ExecutionContext &exe_ctx);
30 public:
31 // Constructors and Destructors
32 StopInfoMachException(Thread &thread, uint32_t exc_type,
33 uint32_t exc_data_count, uint64_t exc_code,
34 uint64_t exc_subcode,
35 bool not_stepping_but_got_singlestep_exception)
36 : StopInfo(thread, exc_type), m_exc_data_count(exc_data_count),
37 m_exc_code(exc_code), m_exc_subcode(exc_subcode),
38 m_not_stepping_but_got_singlestep_exception(
39 not_stepping_but_got_singlestep_exception) {}
41 ~StopInfoMachException() override = default;
43 lldb::StopReason GetStopReason() const override {
44 return lldb::eStopReasonException;
47 const char *GetDescription() override;
49 #if defined(__APPLE__)
50 struct MachException {
51 static const char *Name(exception_type_t exc_type);
52 static std::optional<exception_type_t> ExceptionCode(const char *name);
54 #endif
56 // Since some mach exceptions will be reported as breakpoints, signals,
57 // or trace, we use this static accessor which will translate the mach
58 // exception into the correct StopInfo.
59 static lldb::StopInfoSP CreateStopReasonWithMachException(
60 Thread &thread, uint32_t exc_type, uint32_t exc_data_count,
61 uint64_t exc_code, uint64_t exc_sub_code, uint64_t exc_sub_sub_code,
62 bool pc_already_adjusted = true, bool adjust_pc_if_needed = false);
64 bool WasContinueInterrupted(Thread &thread) override;
66 protected:
67 uint32_t m_exc_data_count;
68 uint64_t m_exc_code;
69 uint64_t m_exc_subcode;
71 bool m_not_stepping_but_got_singlestep_exception;
74 } // namespace lldb_private
76 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_STOPINFOMACHEXCEPTION_H