| 1 | //===-- RegisterContextPOSIX_ppc64le.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_UTILITY_REGISTERCONTEXTPOSIX_PPC64LE_H |
| 10 | #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_PPC64LE_H |
| 11 | |
| 12 | #include "Plugins/Process/Utility/lldb-ppc64le-register-enums.h" |
| 13 | #include "RegisterInfoInterface.h" |
| 14 | #include "Utility/PPC64LE_DWARF_Registers.h" |
| 15 | #include "lldb/Target/RegisterContext.h" |
| 16 | #include "lldb/Utility/Log.h" |
| 17 | |
| 18 | class RegisterContextPOSIX_ppc64le : public lldb_private::RegisterContext { |
| 19 | public: |
| 20 | RegisterContextPOSIX_ppc64le( |
| 21 | lldb_private::Thread &thread, uint32_t concrete_frame_idx, |
| 22 | lldb_private::RegisterInfoInterface *register_info); |
| 23 | |
| 24 | void InvalidateAllRegisters() override; |
| 25 | |
| 26 | size_t GetRegisterCount() override; |
| 27 | |
| 28 | virtual size_t GetGPRSize(); |
| 29 | |
| 30 | virtual unsigned GetRegisterSize(unsigned reg); |
| 31 | |
| 32 | virtual unsigned GetRegisterOffset(unsigned reg); |
| 33 | |
| 34 | const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override; |
| 35 | |
| 36 | size_t GetRegisterSetCount() override; |
| 37 | |
| 38 | const lldb_private::RegisterSet *GetRegisterSet(size_t set) override; |
| 39 | |
| 40 | const char *GetRegisterName(unsigned reg); |
| 41 | |
| 42 | protected: |
| 43 | // 64-bit general purpose registers. |
| 44 | uint64_t m_gpr_ppc64le[k_num_gpr_registers_ppc64le]; |
| 45 | |
| 46 | // floating-point registers including extended register. |
| 47 | uint64_t m_fpr_ppc64le[k_num_fpr_registers_ppc64le]; |
| 48 | |
| 49 | // VMX registers. |
| 50 | uint64_t m_vmx_ppc64le[k_num_vmx_registers_ppc64le * 2]; |
| 51 | |
| 52 | // VSX registers. |
| 53 | uint64_t m_vsx_ppc64le[k_num_vsx_registers_ppc64le * 2]; |
| 54 | |
| 55 | std::unique_ptr<lldb_private::RegisterInfoInterface> m_register_info_up; |
| 56 | |
| 57 | // Determines if an extended register set is supported on the processor |
| 58 | // running the inferior process. |
| 59 | virtual bool IsRegisterSetAvailable(size_t set_index); |
| 60 | |
| 61 | virtual const lldb_private::RegisterInfo *GetRegisterInfo(); |
| 62 | |
| 63 | bool IsGPR(unsigned reg); |
| 64 | |
| 65 | bool IsFPR(unsigned reg); |
| 66 | |
| 67 | bool IsVMX(unsigned reg); |
| 68 | |
| 69 | bool IsVSX(unsigned reg); |
| 70 | |
| 71 | }; |
| 72 | |
| 73 | #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_PPC64LE_H |
| 74 | |