/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/include/lldb/Target/AppleArm64ExceptionClass.h
Line | Count | Source (jump to first uncovered line) |
1 | | //===-- AppleArm64ExceptionClass.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 | | //===----------------------------------------------------------------------===// |
8 | | |
9 | | #ifndef LLDB_TARGET_APPLEARM64EXCEPTIONCLASS_H |
10 | | #define LLDB_TARGET_APPLEARM64EXCEPTIONCLASS_H |
11 | | |
12 | | #include <cstdint> |
13 | | |
14 | | namespace lldb_private { |
15 | | |
16 | | enum class AppleArm64ExceptionClass : unsigned { |
17 | | #define APPLE_ARM64_EXCEPTION_CLASS(Name, Code) Name = Code, |
18 | | #include "AppleArm64ExceptionClass.def" |
19 | | }; |
20 | | |
21 | | /// Get the Apple ARM64 exception class encoded within \p esr. |
22 | 1 | inline AppleArm64ExceptionClass getAppleArm64ExceptionClass(uint32_t esr) { |
23 | | /* |
24 | | * Exception Syndrome Register |
25 | | * |
26 | | * 31 26 25 24 0 |
27 | | * +------+--+------------------+ |
28 | | * | EC |IL| ISS | |
29 | | * +------+--+------------------+ |
30 | | * |
31 | | * EC - Exception Class |
32 | | * IL - Instruction Length |
33 | | * ISS - Instruction Specific Syndrome |
34 | | */ |
35 | 1 | return static_cast<AppleArm64ExceptionClass>(esr >> 26); |
36 | 1 | } |
37 | | |
38 | 1 | inline const char *toString(AppleArm64ExceptionClass EC) { |
39 | 1 | switch (EC) { |
40 | 0 | #define APPLE_ARM64_EXCEPTION_CLASS(Name, Code) \ |
41 | 1 | case AppleArm64ExceptionClass::Name: \ |
42 | 1 | return #Name; |
43 | 1 | #include "AppleArm64ExceptionClass.def"0 |
44 | 1 | } |
45 | 0 | return "Unknown Exception Class"; |
46 | 1 | } |
47 | | |
48 | | } // namespace lldb_private |
49 | | |
50 | | #endif // LLDB_TARGET_APPLEARM64EXCEPTIONCLASS_H |