19#include "llvm/ADT/STLExtras.h"
29 uint32_t concrete_frame_idx)
31 m_context_stale(true) {}
53 assert(data_sp->GetByteSize() >=
sizeof(
m_context));
64 for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx) {
67 if (reg_info->
kinds[kind] == num)
78 uint32_t size,
bool read,
98#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)
99 unsigned shift = 2 * slot;
104 shift = 18 + 4 * slot;
106 m_context.Dr7 |= (size == 8 ? 2ULL : size - 1) << shift;
108 shift = 16 + 4 * slot;
110 m_context.Dr7 |= (read ? 3ULL : (write ? 1ULL : 0)) << shift;
116 LLDB_LOG(log,
"hardware breakpoints not currently supported on this arch");
128#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)
129 unsigned shift = 2 * slot;
142#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)
164 if (!::GetThreadContext(
169 "GetThreadContext failed with error {0} while caching register values.",
178 LLDB_LOG(log,
"successfully updated the register values.");
185 return ::SetThreadContext(
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
const DWORD kWinContextFlags
A subclass of DataBuffer that stores a data buffer on the heap.
lldb::thread_t GetSystemHandle() const
HostNativeThread & GetNativeThread()
virtual ~RegisterContextWindows()
virtual bool ApplyAllRegisterValues()
bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override
bool ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override
virtual bool CacheAllRegisterValues()
static constexpr unsigned NUM_HARDWARE_BREAKPOINT_SLOTS
void InvalidateAllRegisters() override
uint32_t GetTriggeredHardwareBreakpointSlotId()
bool RemoveHardwareBreakpoint(uint32_t slot)
uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override
Convert from a given register numbering scheme to the lldb register numbering scheme.
bool HardwareSingleStep(bool enable) override
bool AddHardwareBreakpoint(uint32_t slot, lldb::addr_t address, uint32_t size, bool read, bool write)
RegisterContextWindows(Thread &thread, uint32_t concrete_frame_idx)
virtual const RegisterInfo * GetRegisterInfoAtIndex(size_t reg)=0
virtual size_t GetRegisterCount()=0
HostThread GetHostThread() const
#define LLDB_INVALID_INDEX32
#define LLDB_INVALID_REGNUM
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.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
RegisterKind
Register numbering types.
Every register is described in detail including its name, alternate name (optional),...
uint32_t kinds[lldb::kNumRegisterKinds]
Holds all of the various register numbers for all register kinds.