Coverage Report

Created: 2022-01-18 06:27

/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
0
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
0
  return static_cast<AppleArm64ExceptionClass>(esr >> 26);
36
0
}
37
38
0
inline const char *toString(AppleArm64ExceptionClass EC) {
39
0
  switch (EC) {
40
0
#define APPLE_ARM64_EXCEPTION_CLASS(Name, Code)                                \
41
0
  case AppleArm64ExceptionClass::Name:                                         \
42
0
    return #Name;
43
0
#include "AppleArm64ExceptionClass.def"
44
0
  }
45
0
  return "Unknown Exception Class";
46
0
}
47
48
} // namespace lldb_private
49
50
#endif // LLDB_TARGET_APPLEARM64EXCEPTIONCLASS_H