1 //===-- RegisterContextMinidump_ARM.h ---------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_REGISTERCONTEXTMINIDUMP_ARM_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_REGISTERCONTEXTMINIDUMP_ARM_H
12 #include "MinidumpTypes.h"
14 #include "Plugins/Process/Utility/RegisterInfoInterface.h"
16 #include "lldb/Target/RegisterContext.h"
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/BitmaskEnum.h"
24 namespace lldb_private
{
28 LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
30 class RegisterContextMinidump_ARM
: public lldb_private::RegisterContext
{
32 RegisterContextMinidump_ARM(lldb_private::Thread
&thread
,
33 const DataExtractor
&data
, bool apple
);
35 ~RegisterContextMinidump_ARM() override
= default;
37 void InvalidateAllRegisters() override
{
38 // Do nothing... registers are always valid...
41 // Used for unit testing.
42 static size_t GetRegisterCountStatic();
43 // Used for unit testing.
44 static const lldb_private::RegisterInfo
*
45 GetRegisterInfoAtIndexStatic(size_t reg
, bool apple
);
47 size_t GetRegisterCount() override
;
49 const lldb_private::RegisterInfo
*GetRegisterInfoAtIndex(size_t reg
) override
;
51 size_t GetRegisterSetCount() override
;
53 const lldb_private::RegisterSet
*GetRegisterSet(size_t set
) override
;
55 const char *GetRegisterName(unsigned reg
);
57 bool ReadRegister(const RegisterInfo
*reg_info
,
58 RegisterValue
®_value
) override
;
60 bool WriteRegister(const RegisterInfo
*reg_info
,
61 const RegisterValue
®_value
) override
;
63 uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind
,
64 uint32_t num
) override
;
66 // Reference: see breakpad/crashpad source
73 uint32_t context_flags
;
86 enum class Flags
: uint32_t {
87 ARM_Flag
= 0x40000000,
88 Integer
= ARM_Flag
| 0x00000002,
89 FloatingPoint
= ARM_Flag
| 0x00000004,
90 LLVM_MARK_AS_BITMASK_ENUM(/* LargestValue = */ FloatingPoint
)
93 const bool m_apple
; // True if this is an Apple ARM where FP is R7
96 } // end namespace minidump
97 } // end namespace lldb_private
98 #endif // LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_REGISTERCONTEXTMINIDUMP_ARM_H