class DebugRegisters

Defined at line 20 of file ../../src/developer/debug/debug_agent/debug_registers.h

Wrapper around the debug thread registers to allow them to be accessed uniformly regardless

of the platform.

Public Methods

void DebugRegisters ()

Defined at line 22 of file ../../src/developer/debug/debug_agent/debug_registers.h

void DebugRegisters (const zx_thread_state_debug_regs_t & r)

Defined at line 23 of file ../../src/developer/debug/debug_agent/debug_registers.h

zx_thread_state_debug_regs_t & GetNativeRegisters ()

Defined at line 65 of file ../../src/developer/debug/debug_agent/debug_registers.h

const zx_thread_state_debug_regs_t & GetNativeRegisters ()

Defined at line 66 of file ../../src/developer/debug/debug_agent/debug_registers.h

bool SetHWBreakpoint (uint64_t address)

Fills the given state the debug registers to what it should be if we added an execution HW

breakpoint for |address|. Return false if there are no registers left.

Defined at line 200 of file ../../src/developer/debug/debug_agent/debug_registers_x64.cc

bool RemoveHWBreakpoint (uint64_t address)

Removes an installed execution HW breakpoint for |address|. If the address is not installed, no

functional change will happen and false will be returned.

Defined at line 223 of file ../../src/developer/debug/debug_agent/debug_registers_x64.cc

std::optional<WatchpointInfo> SetWatchpoint (debug_ipc::BreakpointType type, const debug::AddressRange & range, uint32_t watchpoint_count)

Update the debug registers to install the given watchpoint. The type must be a watchpoint type

(kWrite or kReadWrite).

The watchpoint count should be the number of hardware watchpoints on the current system. It is

passed as a parameter here to allow this function to be tested under different conditions.

The address has to be correctly aligned according to its length or an error will be returned.

The possible values for the size are:

size = 1: 1 byte aligned address.

size = 2: 2 byte aligned address.

size = 4: 4 byte aligned address.

size = 8: 8 byte aligned address.

Any other |size| values will return error.

Defined at line 244 of file ../../src/developer/debug/debug_agent/debug_registers_x64.cc

bool RemoveWatchpoint (const debug::AddressRange & range, uint32_t watchpoint_count)

Updates the debug registers to remove an installed watchpoint for the given range. Returns

true on success, false if the range is not installed.

Defined at line 283 of file ../../src/developer/debug/debug_agent/debug_registers_x64.cc

std::optional<WatchpointInfo> DecodeHitWatchpoint ()

Decodes the debug registers given the state after a watchpoint exception has been thrown.

Defined at line 308 of file ../../src/developer/debug/debug_agent/debug_registers_x64.cc

void SetForHitWatchpoint (int slot)

Sets the debug registers to indicate a hit of the watchpoint of the given slot. This is used in

tests to set up calls for DecodeHitWatchpoint() to succeed.

Defined at line 336 of file ../../src/developer/debug/debug_agent/debug_registers_x64.cc

std::string ToString ()

Defined at line 356 of file ../../src/developer/debug/debug_agent/debug_registers_x64.cc