Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:53

0001 //===-- AppleArm64ExceptionClass.h ------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_TARGET_APPLEARM64EXCEPTIONCLASS_H
0010 #define LLDB_TARGET_APPLEARM64EXCEPTIONCLASS_H
0011 
0012 #include <cstdint>
0013 
0014 namespace lldb_private {
0015 
0016 enum class AppleArm64ExceptionClass : unsigned {
0017 #define APPLE_ARM64_EXCEPTION_CLASS(Name, Code) Name = Code,
0018 #include "AppleArm64ExceptionClass.def"
0019 };
0020 
0021 /// Get the Apple ARM64 exception class encoded within \p esr.
0022 inline AppleArm64ExceptionClass getAppleArm64ExceptionClass(uint32_t esr) {
0023   /*
0024    * Exception Syndrome Register
0025    *
0026    *  31  26 25 24               0
0027    * +------+--+------------------+
0028    * |  EC  |IL|       ISS        |
0029    * +------+--+------------------+
0030    *
0031    * EC  - Exception Class
0032    * IL  - Instruction Length
0033    * ISS - Instruction Specific Syndrome
0034    */
0035   return static_cast<AppleArm64ExceptionClass>(esr >> 26);
0036 }
0037 
0038 inline const char *toString(AppleArm64ExceptionClass EC) {
0039   switch (EC) {
0040 #define APPLE_ARM64_EXCEPTION_CLASS(Name, Code)                                \
0041   case AppleArm64ExceptionClass::Name:                                         \
0042     return #Name;
0043 #include "AppleArm64ExceptionClass.def"
0044   }
0045   return "Unknown Exception Class";
0046 }
0047 
0048 } // namespace lldb_private
0049 
0050 #endif // LLDB_TARGET_APPLEARM64EXCEPTIONCLASS_H