LLDB mainline
NativeRegisterContextAIX_ppc64.h
Go to the documentation of this file.
1//===------ NativeRegisterContextAIX_ppc64.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#if defined(__powerpc64__)
10
11#ifndef LLDB_SOURCE_PLUGINS_PROCESS_AIX_NATIVEREGISTERCONTEXTAIX_PPC64_H
12#define LLDB_SOURCE_PLUGINS_PROCESS_AIX_NATIVEREGISTERCONTEXTAIX_PPC64_H
13
16
17#define DECLARE_REGISTER_INFOS_PPC64_STRUCT
19#undef DECLARE_REGISTER_INFOS_PPC64_STRUCT
20
21namespace lldb_private {
22namespace process_aix {
23
25
26class NativeRegisterContextAIX_ppc64 : public NativeRegisterContextAIX {
27public:
28 NativeRegisterContextAIX_ppc64(const ArchSpec &target_arch,
29 NativeThreadProtocol &native_thread);
30
31 uint32_t GetRegisterSetCount() const override;
32
33 uint32_t GetUserRegisterCount() const override;
34
35 const RegisterSet *GetRegisterSet(uint32_t set_index) const override;
36
37 Status ReadRegister(const RegisterInfo *reg_info,
38 RegisterValue &reg_value) override;
39
40 Status WriteRegister(const RegisterInfo *reg_info,
41 const RegisterValue &reg_value) override;
42
43 Status ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override;
44
45 Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
46
47protected:
48 void *GetGPRBuffer() override { return m_gpr; }
49
50 void *GetFPRBuffer() override { return nullptr; }
51
52 size_t GetFPRSize() override { return 0; }
53
54private:
55 bool IsGPR(unsigned reg) const;
56
57 bool IsFPR(unsigned reg) const;
58
59 bool IsVMX(unsigned reg) const;
60
61 bool IsVSX(unsigned reg) const;
62
63 uint32_t CalculateFprOffset(const RegisterInfo *reg_info) const;
64
65 uint32_t CalculateVmxOffset(const RegisterInfo *reg_info) const;
66
67 uint32_t CalculateVsxOffset(const RegisterInfo *reg_info) const;
68
69 union GPRStorage {
70 GPR_PPC gpr32; // 32-bit general purpose registers.
71 GPR_PPC64 gpr64; // 64-bit general purpose registers.
72 } m_gpr_storage;
73
74 void *m_gpr = nullptr;
75};
76
77} // namespace process_aix
78} // namespace lldb_private
79
80#endif // #ifndef LLDB_SOURCE_PLUGINS_PROCESS_AIX_NATIVEREGISTERCONTEXTAIX_H
81
82#endif // defined(__powerpc64__)
Manages communication with the inferior (debugee) process.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP