Path: blob/main/contrib/llvm-project/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM.h
96386 views
//===-- RegisterContextMinidump_ARM.h ---------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_REGISTERCONTEXTMINIDUMP_ARM_H9#define LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_REGISTERCONTEXTMINIDUMP_ARM_H1011#include "MinidumpTypes.h"1213#include "Plugins/Process/Utility/RegisterInfoInterface.h"1415#include "lldb/Target/RegisterContext.h"1617#include "llvm/ADT/ArrayRef.h"18#include "llvm/ADT/BitmaskEnum.h"1920// C includes21// C++ includes2223namespace lldb_private {2425namespace minidump {2627LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();2829class RegisterContextMinidump_ARM : public lldb_private::RegisterContext {30public:31RegisterContextMinidump_ARM(lldb_private::Thread &thread,32const DataExtractor &data, bool apple);3334~RegisterContextMinidump_ARM() override = default;3536void InvalidateAllRegisters() override {37// Do nothing... registers are always valid...38}3940// Used for unit testing.41static size_t GetRegisterCountStatic();42// Used for unit testing.43static const lldb_private::RegisterInfo *44GetRegisterInfoAtIndexStatic(size_t reg, bool apple);4546size_t GetRegisterCount() override;4748const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;4950size_t GetRegisterSetCount() override;5152const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;5354const char *GetRegisterName(unsigned reg);5556bool ReadRegister(const RegisterInfo *reg_info,57RegisterValue ®_value) override;5859bool WriteRegister(const RegisterInfo *reg_info,60const RegisterValue ®_value) override;6162uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind,63uint32_t num) override;6465// Reference: see breakpad/crashpad source66struct QRegValue {67uint64_t lo;68uint64_t hi;69};7071struct Context {72uint32_t context_flags;73uint32_t r[16];74uint32_t cpsr;75uint64_t fpscr;76union {77uint64_t d[32];78uint32_t s[32];79QRegValue q[16];80};81uint32_t extra[8];82};8384protected:85enum class Flags : uint32_t {86ARM_Flag = 0x40000000,87Integer = ARM_Flag | 0x00000002,88FloatingPoint = ARM_Flag | 0x00000004,89LLVM_MARK_AS_BITMASK_ENUM(/* LargestValue = */ FloatingPoint)90};91Context m_regs;92const bool m_apple; // True if this is an Apple ARM where FP is R793};9495} // end namespace minidump96} // end namespace lldb_private97#endif // LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_REGISTERCONTEXTMINIDUMP_ARM_H9899100