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 
24 namespace lldb_private {
25 
26 namespace minidump {
27 
29 
31 public:
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 {
74  uint32_t r[16];
76  uint64_t fpscr;
77  union {
78  uint64_t d[32];
79  uint32_t s[32];
80  QRegValue q[16];
81  };
83  };
84 
85 protected:
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
lldb_private::minidump::RegisterContextMinidump_ARM::WriteRegister
bool WriteRegister(const RegisterInfo *reg_info, const RegisterValue &reg_value) override
Definition: RegisterContextMinidump_ARM.cpp:529
lldb_private::minidump::RegisterContextMinidump_ARM::GetRegisterSetCount
size_t GetRegisterSetCount() override
Definition: RegisterContextMinidump_ARM.cpp:504
lldb_private::minidump::RegisterContextMinidump_ARM::Context::s
uint32_t s[32]
Definition: RegisterContextMinidump_ARM.h:79
lldb_private::minidump::RegisterContextMinidump_ARM::m_apple
const bool m_apple
Definition: RegisterContextMinidump_ARM.h:93
lldb_private::minidump::RegisterContextMinidump_ARM::Flags::ARM_Flag
@ ARM_Flag
lldb_private::RegisterValue
Definition: RegisterValue.h:28
lldb_private::minidump::LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE()
lldb_private::minidump::RegisterContextMinidump_ARM::Flags::Integer
@ Integer
MinidumpTypes.h
lldb_private::minidump::RegisterContextMinidump_ARM::RegisterContextMinidump_ARM
RegisterContextMinidump_ARM(lldb_private::Thread &thread, const DataExtractor &data, bool apple)
Definition: RegisterContextMinidump_ARM.cpp:458
lldb_private::minidump::RegisterContextMinidump_ARM::Context::r
uint32_t r[16]
Definition: RegisterContextMinidump_ARM.h:74
lldb_private::minidump::RegisterContextMinidump_ARM::m_regs
Context m_regs
Definition: RegisterContextMinidump_ARM.h:92
lldb_private::minidump::RegisterContextMinidump_ARM::Context
Definition: RegisterContextMinidump_ARM.h:72
RegisterInfoInterface.h
lldb_private::minidump::RegisterContextMinidump_ARM::Context::cpsr
uint32_t cpsr
Definition: RegisterContextMinidump_ARM.h:75
lldb_private::minidump::RegisterContextMinidump_ARM::InvalidateAllRegisters
void InvalidateAllRegisters() override
Definition: RegisterContextMinidump_ARM.h:37
lldb_private::minidump::RegisterContextMinidump_ARM::GetRegisterInfoAtIndexStatic
static const lldb_private::RegisterInfo * GetRegisterInfoAtIndexStatic(size_t reg, bool apple)
Definition: RegisterContextMinidump_ARM.cpp:484
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::minidump::RegisterContextMinidump_ARM
Definition: RegisterContextMinidump_ARM.h:30
lldb_private::minidump::RegisterContextMinidump_ARM::Context::context_flags
uint32_t context_flags
Definition: RegisterContextMinidump_ARM.h:73
lldb_private::Thread
Definition: Thread.h:60
lldb_private::minidump::RegisterContextMinidump_ARM::GetRegisterCountStatic
static size_t GetRegisterCountStatic()
Definition: RegisterContextMinidump_ARM.cpp:472
lldb_private::minidump::RegisterContextMinidump_ARM::Context::q
QRegValue q[16]
Definition: RegisterContextMinidump_ARM.h:80
lldb_private::minidump::RegisterContextMinidump_ARM::ConvertRegisterKindToRegisterNumber
uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override
Convert from a given register numbering scheme to the lldb register numbering scheme.
Definition: RegisterContextMinidump_ARM.cpp:534
lldb_private::minidump::RegisterContextMinidump_ARM::QRegValue::lo
uint64_t lo
Definition: RegisterContextMinidump_ARM.h:68
lldb_private::minidump::RegisterContextMinidump_ARM::Context::d
uint64_t d[32]
Definition: RegisterContextMinidump_ARM.h:78
set
set(option_framework FRAMEWORK) endif() if(LLDB_ENABLE_PYTHON) get_target_property(python_bindings_dir swig_wrapper_python BINARY_DIR) set(lldb_python_wrapper $
Definition: API/CMakeLists.txt:9
lldb_private::RegisterContext
Definition: RegisterContext.h:17
lldb_private::minidump::RegisterContextMinidump_ARM::GetRegisterCount
size_t GetRegisterCount() override
Definition: RegisterContextMinidump_ARM.cpp:478
lldb::RegisterKind
RegisterKind
Register numbering types.
Definition: lldb-enumerations.h:227
lldb_private::minidump::RegisterContextMinidump_ARM::GetRegisterName
const char * GetRegisterName(unsigned reg)
Definition: RegisterContextMinidump_ARM.cpp:514
lldb_private::minidump::RegisterContextMinidump_ARM::GetRegisterInfoAtIndex
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
Definition: RegisterContextMinidump_ARM.cpp:500
lldb_private::minidump::RegisterContextMinidump_ARM::Context::fpscr
uint64_t fpscr
Definition: RegisterContextMinidump_ARM.h:76
uint32_t
lldb_private::minidump::RegisterContextMinidump_ARM::QRegValue
Definition: RegisterContextMinidump_ARM.h:67
lldb_private::minidump::RegisterContextMinidump_ARM::Flags
Flags
Definition: RegisterContextMinidump_ARM.h:86
lldb_private::minidump::RegisterContextMinidump_ARM::Context::extra
uint32_t extra[8]
Definition: RegisterContextMinidump_ARM.h:82
lldb_private::minidump::RegisterContextMinidump_ARM::~RegisterContextMinidump_ARM
~RegisterContextMinidump_ARM() override=default
lldb_private::minidump::RegisterContextMinidump_ARM::GetRegisterSet
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
Definition: RegisterContextMinidump_ARM.cpp:508
lldb_private::minidump::RegisterContextMinidump_ARM::ReadRegister
bool ReadRegister(const RegisterInfo *reg_info, RegisterValue &reg_value) override
Definition: RegisterContextMinidump_ARM.cpp:520
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::minidump::RegisterContextMinidump_ARM::Flags::FloatingPoint
@ FloatingPoint
RegisterContext.h
lldb_private::minidump::RegisterContextMinidump_ARM::QRegValue::hi
uint64_t hi
Definition: RegisterContextMinidump_ARM.h:69