Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Plugins / Process / minidump / RegisterContextMinidump_ARM64.h
blob8ae751095c04fdb5a577f845349e9f4a29d9c9af
1 //===-- RegisterContextMinidump_ARM64.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_MINIDUMP_REGISTERCONTEXTMINIDUMP_ARM64_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_REGISTERCONTEXTMINIDUMP_ARM64_H
12 #include "MinidumpTypes.h"
14 #include "Plugins/Process/Utility/RegisterInfoInterface.h"
15 #include "lldb/Target/RegisterContext.h"
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/ADT/BitmaskEnum.h"
20 // C includes
21 // C++ includes
23 namespace lldb_private {
25 namespace minidump {
27 LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
29 class RegisterContextMinidump_ARM64 : public lldb_private::RegisterContext {
30 public:
31 RegisterContextMinidump_ARM64(lldb_private::Thread &thread,
32 const DataExtractor &data);
34 ~RegisterContextMinidump_ARM64() override = default;
36 void InvalidateAllRegisters() override {
37 // Do nothing... registers are always valid...
40 size_t GetRegisterCount() override;
42 const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
44 size_t GetRegisterSetCount() override;
46 const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
48 const char *GetRegisterName(unsigned reg);
50 bool ReadRegister(const RegisterInfo *reg_info,
51 RegisterValue &reg_value) override;
53 bool WriteRegister(const RegisterInfo *reg_info,
54 const RegisterValue &reg_value) override;
56 uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind,
57 uint32_t num) override;
59 // Reference: see breakpad/crashpad source
60 struct Context {
61 uint64_t context_flags;
62 uint64_t x[32];
63 uint64_t pc;
64 uint32_t cpsr;
65 uint32_t fpsr;
66 uint32_t fpcr;
67 uint8_t v[32 * 16]; // 32 128-bit floating point registers
70 protected:
71 enum class Flags : uint32_t {
72 ARM64_Flag = 0x80000000,
73 Integer = ARM64_Flag | 0x00000002,
74 FloatingPoint = ARM64_Flag | 0x00000004,
75 LLVM_MARK_AS_BITMASK_ENUM(/* LargestValue = */ FloatingPoint)
77 Context m_regs;
80 } // end namespace minidump
81 } // end namespace lldb_private
82 #endif // LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_REGISTERCONTEXTMINIDUMP_ARM64_H