Lines Matching defs:wp_index

17 // Returns mask/value for status bit of wp_index in DR6
18 static inline uint64_t GetStatusBit(uint32_t wp_index) {
21 return 1ULL << wp_index;
24 // Returns mask/value for global enable bit of wp_index in DR7
25 static inline uint64_t GetEnableBit(uint32_t wp_index) {
30 return 1ULL << (2 * wp_index + 1);
33 // Returns mask for both enable bits of wp_index in DR7
34 static inline uint64_t GetBothEnableBitMask(uint32_t wp_index) {
37 return 3ULL << (2 * wp_index + 1);
40 // Returns value for type bits of wp_index in DR7
42 uint32_t wp_index) {
50 return static_cast<uint64_t>(watch_flags) << (16 + 4 * wp_index);
53 // Returns value for size bits of wp_index in DR7
54 static inline uint64_t GetWatchSizeBits(uint32_t size, uint32_t wp_index) {
67 << (18 + 4 * wp_index);
70 // Returns bitmask for all bits controlling wp_index in DR7
71 static inline uint64_t GetWatchControlBitmask(uint32_t wp_index) {
77 return GetBothEnableBitMask(wp_index) | (0xF << (16 + 4 * wp_index));
95 Status NativeRegisterContextDBReg_x86::IsWatchpointHit(uint32_t wp_index,
97 if (wp_index >= NumSupportedHardwareWatchpoints())
105 is_hit = dr6.GetAsUInt64() & GetStatusBit(wp_index);
111 NativeRegisterContextDBReg_x86::GetWatchpointHitIndex(uint32_t &wp_index,
114 for (wp_index = 0; wp_index < num_hw_wps; ++wp_index) {
116 Status error = IsWatchpointHit(wp_index, is_hit);
118 wp_index = LLDB_INVALID_INDEX32;
124 wp_index = LLDB_INVALID_INDEX32;
128 Status NativeRegisterContextDBReg_x86::IsWatchpointVacant(uint32_t wp_index,
130 if (wp_index >= NumSupportedHardwareWatchpoints())
138 is_vacant = !(dr7.GetAsUInt64() & GetEnableBit(wp_index));
144 lldb::addr_t addr, size_t size, uint32_t watch_flags, uint32_t wp_index) {
146 if (wp_index >= NumSupportedHardwareWatchpoints())
162 Status error = IsWatchpointVacant(wp_index, is_vacant);
172 error = ReadRegister(GetDR(wp_index), drN);
176 uint64_t control_bits = dr7.GetAsUInt64() & ~GetWatchControlBitmask(wp_index);
177 control_bits |= GetEnableBit(wp_index) |
178 GetWatchTypeBits(watch_flags, wp_index) |
179 GetWatchSizeBits(size, wp_index);
187 (dr7.GetAsUInt64() & GetWatchControlBitmask(wp_index)) !=
188 (GetWatchTypeBits(watch_flags, wp_index) |
189 GetWatchSizeBits(size, wp_index))) {
190 ClearWatchpointHit(wp_index);
193 error = WriteRegister(GetDR(wp_index), RegisterValue(addr));
206 uint32_t wp_index) {
207 if (wp_index >= NumSupportedHardwareWatchpoints())
216 ~GetBothEnableBitMask(wp_index)))
220 Status NativeRegisterContextDBReg_x86::ClearWatchpointHit(uint32_t wp_index) {
221 if (wp_index >= NumSupportedHardwareWatchpoints())
230 GetDR(6), RegisterValue(dr6.GetAsUInt64() & ~GetStatusBit(wp_index)));
247 for (uint32_t wp_index = 0; wp_index < num_hw_watchpoints; ++wp_index) {
249 Status error = IsWatchpointVacant(wp_index, is_vacant);
251 error = SetHardwareWatchpointWithIndex(addr, size, watch_flags, wp_index);
253 return wp_index;
264 NativeRegisterContextDBReg_x86::GetWatchpointAddress(uint32_t wp_index) {
265 if (wp_index >= NumSupportedHardwareWatchpoints())
268 if (ReadRegister(GetDR(wp_index), drN).Fail())