21 return 1ULL << wp_index;
30 return 1ULL << (2 * wp_index + 1);
37 return 3ULL << (2 * wp_index + 1);
50 return static_cast<uint64_t
>(watch_flags) << (16 + 4 * wp_index);
66 return static_cast<uint64_t
>(size == 8 ? 0x2 : size - 1)
67 << (18 + 4 * wp_index);
84 assert(num >= 0 && num <= 7);
86 case llvm::Triple::x86:
88 case llvm::Triple::x86_64:
91 llvm_unreachable(
"Unhandled target architecture.");
114 for (wp_index = 0; wp_index < num_hw_wps; ++wp_index) {
144 lldb::addr_t addr,
size_t size, uint32_t watch_flags, uint32_t wp_index) {
153 if (watch_flags == 2)
156 if (watch_flags != 1 && watch_flags != 3)
158 if (size != 1 && size != 2 && size != 4 && size != 8)
176 uint64_t control_bits = dr7.
GetAsUInt64() & ~GetWatchControlBitmask(wp_index);
247 for (uint32_t wp_index = 0; wp_index < num_hw_watchpoints; ++wp_index) {
255 if (
error.Fail() && log) {
256 LLDB_LOGF(log,
"NativeRegisterContextDBReg_x86::%s Error: %s",
257 __FUNCTION__,
error.AsCString());
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOGF(log,...)
static uint64_t GetWatchControlBitmask(uint32_t wp_index)
static constexpr uint64_t watchpoint_all_control_bit_mask
static uint64_t GetStatusBit(uint32_t wp_index)
static uint64_t GetEnableBit(uint32_t wp_index)
static uint64_t GetWatchSizeBits(uint32_t size, uint32_t wp_index)
static uint64_t GetWatchTypeBits(uint32_t watch_flags, uint32_t wp_index)
static uint64_t GetBothEnableBitMask(uint32_t wp_index)
Status ClearWatchpointHit(uint32_t wp_index) override
bool ClearHardwareWatchpoint(uint32_t wp_index) override
uint32_t NumSupportedHardwareWatchpoints() override
Status SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size, uint32_t watch_flags, uint32_t wp_index)
Status IsWatchpointHit(uint32_t wp_index, bool &is_hit) override
Status ClearAllHardwareWatchpoints() override
lldb::addr_t GetWatchpointAddress(uint32_t wp_index) override
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 const RegisterInfo * GetDR(int num) const
Status IsWatchpointVacant(uint32_t wp_index, bool &is_vacant) override
const RegisterInfoInterface & GetRegisterInfoInterface() const
const RegisterInfo * GetRegisterInfoAtIndex(uint32_t reg_index) const override
virtual Status ReadRegister(const RegisterInfo *reg_info, RegisterValue ®_value)=0
virtual Status WriteRegister(const RegisterInfo *reg_info, const RegisterValue ®_value)=0
uint64_t GetAsUInt64(uint64_t fail_value=UINT64_MAX, bool *success_ptr=nullptr) const
static Status FromErrorString(const char *str)
bool Success() const
Test for success condition.
#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.
Every register is described in detail including its name, alternate name (optional),...