brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · dca24e4 Raw
72 lines · c
1//===-- RegisterContextPOSIX_loongarch64.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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_LOONGARCH64_H10#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_LOONGARCH64_H11 12#include "RegisterInfoInterface.h"13#include "RegisterInfoPOSIX_loongarch64.h"14#include "lldb-loongarch-register-enums.h"15#include "lldb/Target/RegisterContext.h"16#include "lldb/Utility/Log.h"17 18class RegisterContextPOSIX_loongarch64 : public lldb_private::RegisterContext {19public:20  RegisterContextPOSIX_loongarch64(21      lldb_private::Thread &thread,22      std::unique_ptr<RegisterInfoPOSIX_loongarch64> register_info);23 24  ~RegisterContextPOSIX_loongarch64() override;25 26  void invalidate();27 28  void InvalidateAllRegisters() override;29 30  size_t GetRegisterCount() override;31 32  virtual size_t GetGPRSize();33 34  virtual unsigned GetRegisterSize(unsigned reg);35 36  virtual unsigned GetRegisterOffset(unsigned reg);37 38  const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;39 40  size_t GetRegisterSetCount() override;41 42  const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;43 44protected:45  std::unique_ptr<RegisterInfoPOSIX_loongarch64> m_register_info_up;46 47  virtual const lldb_private::RegisterInfo *GetRegisterInfo();48 49  bool IsGPR(unsigned reg);50 51  bool IsFPR(unsigned reg);52 53  bool IsLSX(unsigned reg);54 55  bool IsLASX(unsigned reg);56 57  size_t GetFPRSize() { return sizeof(RegisterInfoPOSIX_loongarch64::FPR); }58 59  uint32_t GetRegNumFCSR() const { return fpr_fcsr_loongarch; }60 61  virtual bool ReadGPR() = 0;62  virtual bool ReadFPR() = 0;63  virtual bool ReadLSX() { return false; }64  virtual bool ReadLASX() { return false; }65  virtual bool WriteGPR() = 0;66  virtual bool WriteFPR() = 0;67  virtual bool WriteLSX() { return false; }68  virtual bool WriteLASX() { return false; }69};70 71#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_LOONGARCH64_H72