Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_types.h>
Go to the source code of this file.
Macros | |
#define | DRXN 8 |
#define | DR_STATUS 6 |
#define | DR_CONTROL 7 |
#define | DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit. */ |
#define | DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit. */ |
#define | DR_ENABLE_SIZE 2 /* Two enable bits per debug register. */ |
#define | DR_CONTROL_RESERVED (0xFC00) |
#define | I386_DR_CONTROL_MASK (~DR_CONTROL_RESERVED) |
#define | DR_LOCAL_SLOWDOWN (0x100) |
#define | DR_GLOBAL_SLOWDOWN (0x200) |
#define | DR_CONTROL_SHIFT 16 |
#define | DR_CONTROL_SIZE 4 |
#define | DR_RW_EXECUTE (0x0) /* Break on instruction execution. */ |
#define | DR_RW_WRITE (0x1) /* Break on data writes. */ |
#define | DR_RW_IORW (0x2) /* Break on I/O reads or writes (not supported (2001) */ |
#define | DR_RW_READ (0x3) /* Break on data reads or writes. */ |
#define | DR_NADDR 4 /* The number of debug address registers. */ |
#define | DR_STATUS 6 /* Index of debug status register (DR6). */ |
#define | DR_CONTROL 7 /* Index of debug control register (DR7). */ |
#define | drxt size_t |
#define | DR_LEN_1 (0 << 2) /* 1-byte region watch or breakpoint. */ |
#define | DR_LEN_2 (1 << 2) /* 2-byte region watch. */ |
#define | DR_LEN_4 (3 << 2) /* 4-byte region watch. */ |
#define | DR_LEN_8 (2 << 2) /* 8-byte region watch (AMD64). */ |
#define | I386_DR_CONTROL_MASK (~DR_CONTROL_RESERVED) |
#define | I386_DR_VACANT(control, i) ((control & (3 << (DR_ENABLE_SIZE * (i)))) == 0) |
#define | I386_DR_LOCAL_ENABLE(control, i) control |= (1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i))) |
#define | I386_DR_GLOBAL_ENABLE(control, i) control |= (1 << (DR_GLOBAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i))) |
#define | I386_DR_IS_LOCAL_ENABLED(control, i) (control & (1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i)))) |
#define | I386_DR_IS_ENABLED(control, i) control &(3 << (DR_ENABLE_SIZE * (i))) |
#define | I386_DR_ENABLE(control, i) control |= (3 << (DR_ENABLE_SIZE * (i))) |
#define | I386_DR_DISABLE(control, i) control &= ~(3 << (DR_ENABLE_SIZE * (i))) |
#define | I386_DR_SET_RW_LEN(control, i, rwlen) |
#define | I386_DR_GET_RW_LEN(control, i) ((control >> (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))) & 0x0f) |
Functions | |
int | drx_set (drxt *drx, int n, ut64 addr, int len, int rwx, int global) |
ut64 | drx_get (drxt *drx, int n, int *rwx, int *len, int *global, int *enabled) |
int | drx_next (drxt *drx) |
int | drx_get_at (drxt *drx, ut64 at_addr) |
void | drx_list (drxt *drx) |
void | drx_init (drxt *r) |
void | drx_enable (drxt *r, int n, int enabled) |
bool | drx_add (RzDebug *dbg, RzBreakpoint *bp, RzBreakpointItem *b) |
bool | drx_del (RzDebug *dbg, RzBreakpoint *bp, RzBreakpointItem *b) |
#define DR_LEN_1 (0 << 2) /* 1-byte region watch or breakpoint. */ |
#define DR_NADDR 4 /* The number of debug address registers. */ |
#define DR_RW_EXECUTE (0x0) /* Break on instruction execution. */ |
#define I386_DR_CONTROL_MASK (~DR_CONTROL_RESERVED) |
#define I386_DR_CONTROL_MASK (~DR_CONTROL_RESERVED) |
#define I386_DR_DISABLE | ( | control, | |
i | |||
) | control &= ~(3 << (DR_ENABLE_SIZE * (i))) |
#define I386_DR_ENABLE | ( | control, | |
i | |||
) | control |= (3 << (DR_ENABLE_SIZE * (i))) |
#define I386_DR_GET_RW_LEN | ( | control, | |
i | |||
) | ((control >> (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))) & 0x0f) |
#define I386_DR_GLOBAL_ENABLE | ( | control, | |
i | |||
) | control |= (1 << (DR_GLOBAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i))) |
#define I386_DR_IS_ENABLED | ( | control, | |
i | |||
) | control &(3 << (DR_ENABLE_SIZE * (i))) |
#define I386_DR_IS_LOCAL_ENABLED | ( | control, | |
i | |||
) | (control & (1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i)))) |
#define I386_DR_LOCAL_ENABLE | ( | control, | |
i | |||
) | control |= (1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i))) |
#define I386_DR_VACANT | ( | control, | |
i | |||
) | ((control & (3 << (DR_ENABLE_SIZE * (i)))) == 0) |
bool drx_add | ( | RzDebug * | dbg, |
RzBreakpoint * | bp, | ||
RzBreakpointItem * | b | ||
) |
Definition at line 209 of file drx.c.
References b, dbg, rz_bp_t::nhwbps, rz_debug_drx_set(), rz_debug_reg_sync(), and RZ_REG_TYPE_DRX.
bool drx_del | ( | RzDebug * | dbg, |
RzBreakpoint * | bp, | ||
RzBreakpointItem * | b | ||
) |
Definition at line 220 of file drx.c.
References dbg, rz_bp_t::nhwbps, rz_debug_drx_unset(), rz_debug_reg_sync(), and RZ_REG_TYPE_DRX.
Definition at line 201 of file drx.c.
References DR_CONTROL, I386_DR_DISABLE, I386_DR_ENABLE, n, and r.
Definition at line 128 of file drx.c.
References DR_CONTROL, DR_LEN_1, DR_LEN_2, DR_LEN_4, DR_LEN_8, I386_DR_GET_RW_LEN, I386_DR_IS_ENABLED, I386_DR_IS_LOCAL_ENABLED, len, n, and ut64().
Referenced by drx_get_at(), and drx_list().
void drx_init | ( | drxt * | r | ) |
void drx_list | ( | drxt * | drx | ) |
Definition at line 178 of file drx.c.
References addr, DR_RW_EXECUTE, DR_RW_IORW, DR_RW_READ, DR_RW_WRITE, drx_get(), g, i, len, PFMT64x, printf(), and ut64().
Definition at line 83 of file drx.c.
References addr, control, DR_CONTROL, DR_NADDR, eprintf, I386_DR_CONTROL_MASK, I386_DR_DISABLE, I386_DR_GLOBAL_ENABLE, I386_DR_LOCAL_ENABLE, I386_DR_SET_RW_LEN, len, and n.