RegisterContextPOSIXProcessMonitor_powerpc.h revision 355940
1//===-- RegisterContextPOSIXProcessMonitor_powerpc.h -------------*- C++
2//-*-===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_RegisterContextPOSIXProcessMonitor_powerpc_H_
11#define liblldb_RegisterContextPOSIXProcessMonitor_powerpc_H_
12
13#include "Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h"
14#include "RegisterContextPOSIX.h"
15
16class RegisterContextPOSIXProcessMonitor_powerpc
17    : public RegisterContextPOSIX_powerpc,
18      public POSIXBreakpointProtocol {
19public:
20  RegisterContextPOSIXProcessMonitor_powerpc(
21      lldb_private::Thread &thread, uint32_t concrete_frame_idx,
22      lldb_private::RegisterInfoInterface *register_info);
23
24protected:
25  bool IsVMX();
26
27  bool ReadGPR();
28
29  bool ReadFPR();
30
31  bool ReadVMX();
32
33  bool WriteGPR();
34
35  bool WriteFPR();
36
37  bool WriteVMX();
38
39  // lldb_private::RegisterContext
40  bool ReadRegister(const unsigned reg, lldb_private::RegisterValue &value);
41
42  bool WriteRegister(const unsigned reg,
43                     const lldb_private::RegisterValue &value);
44
45  bool ReadRegister(const lldb_private::RegisterInfo *reg_info,
46                    lldb_private::RegisterValue &value);
47
48  bool WriteRegister(const lldb_private::RegisterInfo *reg_info,
49                     const lldb_private::RegisterValue &value);
50
51  bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp);
52
53  bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp);
54
55  uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size, bool read,
56                                 bool write);
57
58  bool ClearHardwareWatchpoint(uint32_t hw_index);
59
60  bool HardwareSingleStep(bool enable);
61
62  // POSIXBreakpointProtocol
63  bool UpdateAfterBreakpoint();
64
65  unsigned GetRegisterIndexFromOffset(unsigned offset);
66
67  bool IsWatchpointHit(uint32_t hw_index);
68
69  bool ClearWatchpointHits();
70
71  lldb::addr_t GetWatchpointAddress(uint32_t hw_index);
72
73  bool IsWatchpointVacant(uint32_t hw_index);
74
75  bool SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size, bool read,
76                                      bool write, uint32_t hw_index);
77
78  uint32_t NumSupportedHardwareWatchpoints();
79
80private:
81  ProcessMonitor &GetMonitor();
82};
83
84#endif
85