25 "failed to read debug registers: {0}");
36 LLDB_LOG(log,
"addr: {0:x}, size: {1:x}", addr, size);
42 log, std::move(
error),
43 "unable to set breakpoint: failed to read debug registers: {0}");
47 uint32_t control_value = 0, bp_index = 0;
76 m_hbp_regs[bp_index].control &= ~m_hw_dbg_enable_bit;
79 log, std::move(
error),
80 "unable to set breakpoint: failed to write debug registers: {0}");
89 LLDB_LOG(log,
"hw_idx: {0}", hw_idx);
95 log, std::move(
error),
96 "unable to clear breakpoint: failed to read debug registers: {0}");
105 uint32_t tempControl =
m_hbp_regs[hw_idx].control;
107 m_hbp_regs[hw_idx].control &= ~m_hw_dbg_enable_bit;
118 log, std::move(
error),
119 "unable to clear breakpoint: failed to write debug registers: {0}");
131 LLDB_LOGF(log,
"NativeRegisterContextDBReg::%s()", __FUNCTION__);
151 LLDB_LOGF(log,
"NativeRegisterContextDBReg::%s()", __FUNCTION__);
166 m_hbp_regs[i].control &= ~m_hw_dbg_enable_bit;
192 "failed to read debug registers: {0}");
202 LLDB_LOG(log,
"addr: {0:x}, size: {1:x} watch_flags: {2:x}", addr, size,
209 log, std::move(
error),
210 "unable to set watchpoint: failed to read debug registers: {0}");
214 uint32_t control_value = 0, wp_index = 0;
219 if (adjusted == std::nullopt)
221 size = adjusted->size;
222 addr = adjusted->addr;
227 switch (watch_flags) {
228 case lldb::eWatchpointKindWrite:
231 case lldb::eWatchpointKindRead:
234 case (lldb::eWatchpointKindRead | lldb::eWatchpointKindWrite):
265 m_hwp_regs[wp_index].control &= ~m_hw_dbg_enable_bit;
268 log, std::move(
error),
269 "unable to set watchpoint: failed to write debug registers: {0}");
278 LLDB_LOG(log,
"wp_index: {0}", wp_index);
284 log, std::move(
error),
285 "unable to set watchpoint: failed to read debug registers: {0}");
294 uint32_t tempControl =
m_hwp_regs[wp_index].control;
297 m_hwp_regs[wp_index].control &= ~m_hw_dbg_enable_bit;
308 log, std::move(
error),
309 "unable to clear watchpoint: failed to read debug registers: {0}");
351 LLDB_LOG(log,
"wp_index: {0}, trap_addr: {1:x}", wp_index, trap_addr);
369 trap_addr < watch_addr + watch_size) {
381 LLDB_LOG(log,
"wp_index: {0}", wp_index);
388 LLDB_LOG(log,
"wp_index: {0}", wp_index);
401 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,...)
virtual lldb::addr_t FixWatchpointHitAddress(lldb::addr_t hit_addr)
uint32_t NumSupportedHardwareWatchpoints() override
const uint32_t m_hw_dbg_enable_bit
std::array< struct DREG, 16 > m_hbp_regs
Status ClearAllHardwareWatchpoints() override
Status ClearAllHardwareBreakpoints() override
bool ClearHardwareWatchpoint(uint32_t hw_index) override
virtual llvm::Error WriteHardwareDebugRegs(DREGType hwbType)=0
Status GetWatchpointHitIndex(uint32_t &wp_index, lldb::addr_t trap_addr) override
bool WatchpointIsEnabled(uint32_t wp_index)
virtual llvm::Error ReadHardwareDebugInfo()=0
bool BreakpointIsEnabled(uint32_t bp_index)
lldb::addr_t GetWatchpointHitAddress(uint32_t wp_index) override
bool ValidateBreakpoint(size_t size, lldb::addr_t addr)
virtual uint32_t MakeWatchControlValue(size_t size, uint32_t watch_flags)=0
uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags) override
virtual std::optional< WatchpointDetails > AdjustWatchpoint(const WatchpointDetails &details)=0
virtual uint32_t MakeBreakControlValue(size_t size)=0
virtual uint32_t GetWatchpointSize(uint32_t wp_index)=0
bool ClearHardwareBreakpoint(uint32_t hw_idx) override
uint32_t m_max_hbp_supported
uint32_t m_max_hwp_supported
uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override
uint32_t NumSupportedHardwareBreakpoints() override
std::array< struct DREG, 16 > m_hwp_regs
Status GetHardwareBreakHitIndex(uint32_t &bp_index, lldb::addr_t trap_addr) override
lldb::addr_t GetWatchpointAddress(uint32_t wp_index) override
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
#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.