LLDB mainline
RegisterContextMinidump_ARM.h
Go to the documentation of this file.
1//===-- RegisterContextMinidump_ARM.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_SOURCE_PLUGINS_PROCESS_MINIDUMP_REGISTERCONTEXTMINIDUMP_ARM_H
10#define LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_REGISTERCONTEXTMINIDUMP_ARM_H
11
12#include "MinidumpTypes.h"
13
15
17
18#include "llvm/ADT/ArrayRef.h"
19#include "llvm/ADT/BitmaskEnum.h"
20
21// C includes
22// C++ includes
23
24namespace lldb_private {
25
26namespace minidump {
27
29
31public:
33 const DataExtractor &data, bool apple);
34
35 ~RegisterContextMinidump_ARM() override = default;
36
37 void InvalidateAllRegisters() override {
38 // Do nothing... registers are always valid...
39 }
40
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);
46
47 size_t GetRegisterCount() override;
48
49 const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
50
51 size_t GetRegisterSetCount() override;
52
53 const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
54
55 const char *GetRegisterName(unsigned reg);
56
57 bool ReadRegister(const RegisterInfo *reg_info,
58 RegisterValue &reg_value) override;
59
60 bool WriteRegister(const RegisterInfo *reg_info,
61 const RegisterValue &reg_value) override;
62
64 uint32_t num) override;
65
66 // Reference: see breakpad/crashpad source
67 struct QRegValue {
68 uint64_t lo;
69 uint64_t hi;
70 };
71
72 struct Context {
73 uint32_t context_flags;
74 uint32_t r[16];
75 uint32_t cpsr;
76 uint64_t fpscr;
77 union {
78 uint64_t d[32];
79 uint32_t s[32];
81 };
82 uint32_t extra[8];
83 };
84
85protected:
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)
91 };
93 const bool m_apple; // True if this is an Apple ARM where FP is R7
94};
95
96} // end namespace minidump
97} // end namespace lldb_private
98#endif // LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_REGISTERCONTEXTMINIDUMP_ARM_H
An data extractor class.
Definition: DataExtractor.h:48
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override
Convert from a given register numbering scheme to the lldb register numbering scheme.
bool WriteRegister(const RegisterInfo *reg_info, const RegisterValue &reg_value) override
static const lldb_private::RegisterInfo * GetRegisterInfoAtIndexStatic(size_t reg, bool apple)
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
bool ReadRegister(const RegisterInfo *reg_info, RegisterValue &reg_value) override
A class that represents a running process on the host machine.
RegisterKind
Register numbering types.
Every register is described in detail including its name, alternate name (optional),...
Registers are grouped into register sets.