LLDB  mainline
NativeRegisterContextDBReg_arm64.h
Go to the documentation of this file.
1 //===-- NativeRegisterContextDBReg_arm64.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_NativeRegisterContextDBReg_arm64_h
10 #define lldb_NativeRegisterContextDBReg_arm64_h
11 
13 
14 #include <array>
15 
16 namespace lldb_private {
17 
19  : public virtual NativeRegisterContextRegisterInfo {
20 public:
22 
23  uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override;
24 
25  bool ClearHardwareBreakpoint(uint32_t hw_idx) override;
26 
28 
30  lldb::addr_t trap_addr) override;
31 
32  bool BreakpointIsEnabled(uint32_t bp_index);
33 
35 
37  uint32_t watch_flags) override;
38 
39  bool ClearHardwareWatchpoint(uint32_t hw_index) override;
40 
42 
44  lldb::addr_t trap_addr) override;
45 
47 
48  lldb::addr_t GetWatchpointAddress(uint32_t wp_index) override;
49 
51 
52  bool WatchpointIsEnabled(uint32_t wp_index);
53 
54  // Debug register type select
56 
57 protected:
58  // Debug register info for hardware breakpoints and watchpoints management.
59  struct DREG {
60  lldb::addr_t address; // Breakpoint/watchpoint address value.
61  lldb::addr_t hit_addr; // Address at which last watchpoint trigger exception
62  // occurred.
63  lldb::addr_t real_addr; // Address value that should cause target to stop.
64  uint32_t control; // Breakpoint/watchpoint control value.
65  };
66 
67  std::array<struct DREG, 16> m_hbp_regs; // hardware breakpoints
68  std::array<struct DREG, 16> m_hwp_regs; // hardware watchpoints
69 
72 
73  virtual llvm::Error ReadHardwareDebugInfo() = 0;
74  virtual llvm::Error WriteHardwareDebugRegs(DREGType hwbType) = 0;
76  return hit_addr;
77  }
78 };
79 
80 } // namespace lldb_private
81 
82 #endif // #ifndef lldb_NativeRegisterContextDBReg_arm64_h
lldb_private::NativeRegisterContextDBReg_arm64::DREG
Definition: NativeRegisterContextDBReg_arm64.h:59
lldb_private::NativeRegisterContextDBReg_arm64::DREG::hit_addr
lldb::addr_t hit_addr
Definition: NativeRegisterContextDBReg_arm64.h:61
lldb_private::NativeRegisterContextDBReg_arm64::BreakpointIsEnabled
bool BreakpointIsEnabled(uint32_t bp_index)
Definition: NativeRegisterContextDBReg_arm64.cpp:201
lldb_private::NativeRegisterContextDBReg_arm64::m_hwp_regs
std::array< struct DREG, 16 > m_hwp_regs
Definition: NativeRegisterContextDBReg_arm64.h:68
lldb_private::NativeRegisterContextDBReg_arm64::NumSupportedHardwareWatchpoints
uint32_t NumSupportedHardwareWatchpoints() override
Definition: NativeRegisterContextDBReg_arm64.cpp:208
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::NativeRegisterContextDBReg_arm64::WatchpointIsEnabled
bool WatchpointIsEnabled(uint32_t wp_index)
Definition: NativeRegisterContextDBReg_arm64.cpp:404
lldb_private::NativeRegisterContextDBReg_arm64::eDREGTypeBREAK
@ eDREGTypeBREAK
Definition: NativeRegisterContextDBReg_arm64.h:55
lldb_private::NativeRegisterContextDBReg_arm64::DREG::address
lldb::addr_t address
Definition: NativeRegisterContextDBReg_arm64.h:60
lldb_private::NativeRegisterContextDBReg_arm64::SetHardwareWatchpoint
uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags) override
Definition: NativeRegisterContextDBReg_arm64.cpp:220
lldb_private::NativeRegisterContextDBReg_arm64::FixWatchpointHitAddress
virtual lldb::addr_t FixWatchpointHitAddress(lldb::addr_t hit_addr)
Definition: NativeRegisterContextDBReg_arm64.h:75
lldb_private::NativeRegisterContextDBReg_arm64::GetWatchpointHitIndex
Status GetWatchpointHitIndex(uint32_t &wp_index, lldb::addr_t trap_addr) override
Definition: NativeRegisterContextDBReg_arm64.cpp:414
lldb_private::NativeRegisterContextDBReg_arm64::ClearAllHardwareBreakpoints
Status ClearAllHardwareBreakpoints() override
Definition: NativeRegisterContextDBReg_arm64.cpp:166
lldb_private::NativeRegisterContextDBReg_arm64::GetHardwareBreakHitIndex
Status GetHardwareBreakHitIndex(uint32_t &bp_index, lldb::addr_t trap_addr) override
Definition: NativeRegisterContextDBReg_arm64.cpp:145
lldb_private::NativeRegisterContextDBReg_arm64::ClearAllHardwareWatchpoints
Status ClearAllHardwareWatchpoints() override
Definition: NativeRegisterContextDBReg_arm64.cpp:354
lldb_private::NativeRegisterContextDBReg_arm64::GetWatchpointHitAddress
lldb::addr_t GetWatchpointHitAddress(uint32_t wp_index) override
Definition: NativeRegisterContextDBReg_arm64.cpp:459
NativeRegisterContextRegisterInfo.h
lldb_private::NativeRegisterContextDBReg_arm64::eDREGTypeWATCH
@ eDREGTypeWATCH
Definition: NativeRegisterContextDBReg_arm64.h:55
lldb_private::NativeRegisterContextDBReg_arm64::ClearHardwareBreakpoint
bool ClearHardwareBreakpoint(uint32_t hw_idx) override
Definition: NativeRegisterContextDBReg_arm64.cpp:105
lldb_private::NativeRegisterContextDBReg_arm64::ReadHardwareDebugInfo
virtual llvm::Error ReadHardwareDebugInfo()=0
lldb_private::NativeRegisterContextDBReg_arm64::m_max_hwp_supported
uint32_t m_max_hwp_supported
Definition: NativeRegisterContextDBReg_arm64.h:71
lldb_private::NativeRegisterContextDBReg_arm64::GetWatchpointAddress
lldb::addr_t GetWatchpointAddress(uint32_t wp_index) override
Definition: NativeRegisterContextDBReg_arm64.cpp:446
lldb_private::NativeRegisterContextDBReg_arm64::m_hbp_regs
std::array< struct DREG, 16 > m_hbp_regs
Definition: NativeRegisterContextDBReg_arm64.h:67
lldb_private::Status
Definition: Status.h:44
lldb_private::NativeRegisterContextRegisterInfo
Definition: NativeRegisterContextRegisterInfo.h:18
uint32_t
lldb_private::NativeRegisterContextDBReg_arm64
Definition: NativeRegisterContextDBReg_arm64.h:18
lldb_private::NativeRegisterContextDBReg_arm64::WriteHardwareDebugRegs
virtual llvm::Error WriteHardwareDebugRegs(DREGType hwbType)=0
lldb_private::NativeRegisterContextDBReg_arm64::GetWatchpointSize
uint32_t GetWatchpointSize(uint32_t wp_index)
Definition: NativeRegisterContextDBReg_arm64.cpp:386
lldb_private::NativeRegisterContextDBReg_arm64::DREGType
DREGType
Definition: NativeRegisterContextDBReg_arm64.h:55
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:29
lldb_private::NativeRegisterContextDBReg_arm64::ClearHardwareWatchpoint
bool ClearHardwareWatchpoint(uint32_t hw_index) override
Definition: NativeRegisterContextDBReg_arm64.cpp:313
lldb_private::NativeRegisterContextDBReg_arm64::m_max_hbp_supported
uint32_t m_max_hbp_supported
Definition: NativeRegisterContextDBReg_arm64.h:70
lldb_private::NativeRegisterContextDBReg_arm64::NumSupportedHardwareBreakpoints
uint32_t NumSupportedHardwareBreakpoints() override
Definition: NativeRegisterContextDBReg_arm64.cpp:31
lldb_private::NativeRegisterContextDBReg_arm64::SetHardwareBreakpoint
uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override
Definition: NativeRegisterContextDBReg_arm64.cpp:44
lldb_private::NativeRegisterContextDBReg_arm64::DREG::control
uint32_t control
Definition: NativeRegisterContextDBReg_arm64.h:64
lldb_private::NativeRegisterContextDBReg_arm64::DREG::real_addr
lldb::addr_t real_addr
Definition: NativeRegisterContextDBReg_arm64.h:63