Path: blob/main/contrib/llvm-project/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h
96380 views
//===-- NativeRegisterContextDBReg_arm64.h ----------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef lldb_NativeRegisterContextDBReg_arm64_h9#define lldb_NativeRegisterContextDBReg_arm64_h1011#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"1213#include <array>1415namespace lldb_private {1617class NativeRegisterContextDBReg_arm6418: public virtual NativeRegisterContextRegisterInfo {19public:20uint32_t NumSupportedHardwareBreakpoints() override;2122uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override;2324bool ClearHardwareBreakpoint(uint32_t hw_idx) override;2526Status ClearAllHardwareBreakpoints() override;2728Status GetHardwareBreakHitIndex(uint32_t &bp_index,29lldb::addr_t trap_addr) override;3031bool BreakpointIsEnabled(uint32_t bp_index);3233uint32_t NumSupportedHardwareWatchpoints() override;3435uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size,36uint32_t watch_flags) override;3738bool ClearHardwareWatchpoint(uint32_t hw_index) override;3940Status ClearAllHardwareWatchpoints() override;4142Status GetWatchpointHitIndex(uint32_t &wp_index,43lldb::addr_t trap_addr) override;4445lldb::addr_t GetWatchpointHitAddress(uint32_t wp_index) override;4647lldb::addr_t GetWatchpointAddress(uint32_t wp_index) override;4849uint32_t GetWatchpointSize(uint32_t wp_index);5051bool WatchpointIsEnabled(uint32_t wp_index);5253// Debug register type select54enum DREGType { eDREGTypeWATCH = 0, eDREGTypeBREAK };5556protected:57/// Debug register info for hardware breakpoints and watchpoints management.58/// Watchpoints: For a user requested size 4 at addr 0x1004, where BAS59/// watchpoints are at doubleword (8-byte) alignment.60/// \a real_addr is 0x100461/// \a address is 0x100062/// size is 863/// If a one-byte write to 0x1006 is the most recent watchpoint trap,64/// \a hit_addr is 0x100665struct DREG {66lldb::addr_t address; // Breakpoint/watchpoint address value.67lldb::addr_t hit_addr; // Address at which last watchpoint trigger exception68// occurred.69lldb::addr_t real_addr; // Address value that should cause target to stop.70uint32_t control; // Breakpoint/watchpoint control value.71};7273std::array<struct DREG, 16> m_hbp_regs; // hardware breakpoints74std::array<struct DREG, 16> m_hwp_regs; // hardware watchpoints7576uint32_t m_max_hbp_supported;77uint32_t m_max_hwp_supported;7879virtual llvm::Error ReadHardwareDebugInfo() = 0;80virtual llvm::Error WriteHardwareDebugRegs(DREGType hwbType) = 0;81virtual lldb::addr_t FixWatchpointHitAddress(lldb::addr_t hit_addr) {82return hit_addr;83}84};8586} // namespace lldb_private8788#endif // #ifndef lldb_NativeRegisterContextDBReg_arm64_h899091