29 return ((1 << size) - 1) << 5;
37 "failed to read debug registers: {0}");
48 LLDB_LOG(log,
"addr: {0:x}, size: {1:x}", addr, size);
54 log, std::move(
error),
55 "unable to set breakpoint: failed to read debug registers: {0}");
59 uint32_t control_value = 0, bp_index = 0;
98 log, std::move(
error),
99 "unable to set breakpoint: failed to write debug registers: {0}");
109 LLDB_LOG(log,
"hw_idx: {0}", hw_idx);
115 log, std::move(
error),
116 "unable to clear breakpoint: failed to read debug registers: {0}");
125 uint32_t tempControl =
m_hbp_regs[hw_idx].control;
138 log, std::move(
error),
139 "unable to clear breakpoint: failed to write debug registers: {0}");
150 LLDB_LOGF(log,
"NativeRegisterContextDBReg_arm64::%s()", __FUNCTION__);
170 LLDB_LOGF(log,
"NativeRegisterContextDBReg_arm64::%s()", __FUNCTION__);
214 "failed to read debug registers: {0}");
224 LLDB_LOG(log,
"addr: {0:x}, size: {1:x} watch_flags: {2:x}", addr, size,
231 log, std::move(
error),
232 "unable to set watchpoint: failed to read debug registers: {0}");
236 uint32_t control_value = 0, wp_index = 0;
241 switch (watch_flags) {
255 if (size != 1 && size != 2 && size != 4 && size != 8)
262 uint8_t watch_mask = (addr & 0x07) + size;
264 if (watch_mask > 0x08)
266 else if (watch_mask <= 0x02)
268 else if (watch_mask <= 0x04)
273 addr = addr & (~0x07);
278 control_value |= watch_flags << 3;
303 m_hwp_regs[wp_index].control &= ~g_enable_bit;
306 log, std::move(
error),
307 "unable to set watchpoint: failed to write debug registers: {0}");
317 LLDB_LOG(log,
"wp_index: {0}", wp_index);
323 log, std::move(
error),
324 "unable to clear watchpoint: failed to read debug registers: {0}");
333 uint32_t tempControl =
m_hwp_regs[wp_index].control;
336 m_hwp_regs[wp_index].control &= ~g_enable_bit;
347 log, std::move(
error),
348 "unable to clear watchpoint: failed to write debug registers: {0}");
389 LLDB_LOG(log,
"wp_index: {0}", wp_index);
391 switch ((
m_hwp_regs[wp_index].control >> 5) & 0xff) {
407 LLDB_LOG(log,
"wp_index: {0}", wp_index);
418 LLDB_LOG(log,
"wp_index: {0}, trap_addr: {1:x}", wp_index, trap_addr);
436 trap_addr < watch_addr + watch_size) {
449 LLDB_LOG(log,
"wp_index: {0}", wp_index);
462 LLDB_LOG(log,
"wp_index: {0}", wp_index);
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
#define LLDB_LOGF(log,...)
#define LLDB_LOG_ERROR(log, error,...)
constexpr uint32_t g_pac_bits
static constexpr uint64_t GetSizeBits(int size)
constexpr uint32_t g_enable_bit
bool ClearHardwareBreakpoint(uint32_t hw_idx) override
Status ClearAllHardwareBreakpoints() override
Status GetHardwareBreakHitIndex(uint32_t &bp_index, lldb::addr_t trap_addr) override
bool BreakpointIsEnabled(uint32_t bp_index)
Status ClearAllHardwareWatchpoints() override
uint32_t NumSupportedHardwareBreakpoints() override
lldb::addr_t GetWatchpointHitAddress(uint32_t wp_index) override
virtual llvm::Error ReadHardwareDebugInfo()=0
Status GetWatchpointHitIndex(uint32_t &wp_index, lldb::addr_t trap_addr) override
uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags) override
virtual llvm::Error WriteHardwareDebugRegs(DREGType hwbType)=0
uint32_t m_max_hbp_supported
virtual lldb::addr_t FixWatchpointHitAddress(lldb::addr_t hit_addr)
uint32_t NumSupportedHardwareWatchpoints() override
uint32_t GetWatchpointSize(uint32_t wp_index)
bool ClearHardwareWatchpoint(uint32_t hw_index) override
std::array< struct DREG, 16 > m_hwp_regs
uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override
std::array< struct DREG, 16 > m_hbp_regs
uint32_t m_max_hwp_supported
lldb::addr_t GetWatchpointAddress(uint32_t wp_index) override
bool WatchpointIsEnabled(uint32_t wp_index)
#define LLDB_INVALID_INDEX32
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.