63 int endian = bp->endian;
64 int bits = bp->ctx.bits_at ? bp->ctx.bits_at(
addr, bp->ctx.user) : 0;
71 for (
int i = 0;
i < bp->cur->nbps;
i++) {
73 if (bp->cur->bps[
i].bits) {
74 if (!
bits ||
bits != bp->cur->bps[
i].bits) {
78 if (bp->cur->bps[
i].length ==
len && bp->cur->bps[
i].endian ==
endian) {
89 if (
len %
b->length) {
93 for (
int i = 0;
i <
len;
i++) {
106 rz_list_foreach (bp->bps,
iter,
b) {
107 if (
b->addr ==
addr) {
123 rz_list_foreach (bp->bps,
iter,
b) {
124 if (!
b->hw &&
b->addr +
b->size ==
addr) {
132 return (
addr >=
b->addr &&
addr < (
b->addr +
b->size));
136 return (!perm || (perm &&
b->perm));
142 rz_list_foreach (bp->
bps,
iter,
b) {
165 rz_list_foreach (bp->
bps,
iter,
b) {
223 RZ_LOG_ERROR(
"Breakpoint already set at this address.\n");
232 RZ_LOG_ERROR(
"base addr should not be larger than the breakpoint address.\n");
235 RZ_LOG_WARN(
"Breakpoint won't be placed since it's not in a valid map.\n"
236 "You can bypass this check by setting dbg.bpinmaps to false.\n");
260 RZ_LOG_ERROR(
"Cannot get breakpoint bytes. Incorrect architecture/bits selected for software breakpoints?\n");
291 if (bp->iob.read_at) {
305 if (!rz_list_empty(bp->
bps)) {
319 rz_list_foreach (bp->
bps,
iter,
b) {
320 if (
b->addr ==
addr) {
341 rz_list_foreach (bp->
bps,
iter,
b) {
348 if (
idx >= 0 && idx < bp->bps_idx_count) {
365 if (
idx >= 0 && idx < bp->bps_idx_count) {
381 if (!bp || !bp->cur) {
384 for (
i = 0; bp->cur->bps[
i].bytes;
i++) {
385 bpa = &bp->cur->bps[
i];
389 if (bpa->
length < bpsize) {
401 int bits = bp->ctx.bits_at ? bp->ctx.bits_at(
addr, bp->ctx.user) : 0;
426 char *tmp_cond =
NULL;
434 item->cond = tmp_cond;
448 char *tmp_data =
NULL;
456 item->data = tmp_data;
470 char *tmp_expr =
NULL;
478 item->expr = tmp_expr;
492 char *tmp_name =
NULL;
500 item->name = tmp_name;
int bits(struct state *s, int need)
RZ_API RZ_BORROW RzBreakpointItem * rz_bp_get_ending_at(RZ_NONNULL RzBreakpoint *bp, ut64 addr)
Get the breakpoint b that fulfills b->addr + b-> size == addr After hitting a (usually software) brea...
RZ_API int rz_bp_set_trace_all(RzBreakpoint *bp, int set)
RZ_API bool rz_bp_is_valid(RzBreakpoint *bp, RzBreakpointItem *b)
RZ_API int rz_bp_del_index(RzBreakpoint *bp, int idx)
RZ_API RzBreakpointItem * rz_bp_get_in(RzBreakpoint *bp, ut64 addr, int perm)
static void rz_bp_item_free(RzBreakpointItem *b)
static bool matchProt(RzBreakpointItem *b, int perm)
static RzBreakpointItem * rz_bp_add(RzBreakpoint *bp, const ut8 *obytes, ut64 addr, int size, int hw, int perm)
static bool inRange(RzBreakpointItem *b, ut64 addr)
RZ_API RzBreakpointItem * rz_bp_get_index(RzBreakpoint *bp, int idx)
RZ_API int rz_bp_get_index_at(RzBreakpoint *bp, ut64 addr)
RZ_API RzBreakpoint * rz_bp_new(RZ_BORROW RZ_NONNULL RzBreakpointContext *ctx)
RZ_API int rz_bp_set_trace(RzBreakpoint *bp, ut64 addr, int set)
RZ_API bool rz_bp_item_set_data(RZ_NONNULL RzBreakpointItem *item, RZ_NULLABLE const char *data)
set the data for a RzBreakpointItem
RZ_API RZ_BORROW RzBreakpointItem * rz_bp_get_at(RZ_NONNULL RzBreakpoint *bp, ut64 addr)
Get the breakpoint at exactly addr.
RZ_API int rz_bp_size(RZ_NONNULL RzBreakpoint *bp, int bits)
Predict the software breakpoint size to use for the given arch-bitness.
static void unlinkBreakpoint(RzBreakpoint *bp, RzBreakpointItem *b)
RZ_IPI void rz_bp_item_insert(RzBreakpoint *bp, RzBreakpointItem *b)
RZ_API RzBreakpoint * rz_bp_free(RzBreakpoint *bp)
RZ_API bool rz_bp_del(RzBreakpoint *bp, ut64 addr)
RZ_API bool rz_bp_del_all(RzBreakpoint *bp)
RZ_API RzBreakpointItem * rz_bp_add_hw(RzBreakpoint *bp, ut64 addr, int size, int perm)
RZ_API RzBreakpointItem * rz_bp_enable(RzBreakpoint *bp, ut64 addr, int set, int count)
RZ_API bool rz_bp_item_set_cond(RZ_NONNULL RzBreakpointItem *item, RZ_NULLABLE const char *cond)
set the condition for a RzBreakpointItem
RZ_API int rz_bp_add_fault(RzBreakpoint *bp, ut64 addr, int size, int perm)
RZ_API int rz_bp_stepy_continuation(RzBreakpoint *bp)
static struct rz_bp_plugin_t * bp_static_plugins[]
RZ_API int rz_bp_get_bytes(RZ_NONNULL RzBreakpoint *bp, ut64 addr, RZ_NONNULL ut8 *buf, int len)
RZ_API bool rz_bp_enable_all(RzBreakpoint *bp, int set)
RZ_API bool rz_bp_item_set_name(RZ_NONNULL RzBreakpointItem *item, RZ_NULLABLE const char *name)
set the name for a RzBreakpointItem
RZ_API bool rz_bp_item_set_expr(RZ_NONNULL RzBreakpointItem *item, RZ_NULLABLE const char *expr)
set the expr for a RzBreakpointItem
RZ_API RZ_BORROW RzBreakpointItem * rz_bp_add_sw(RZ_NONNULL RzBreakpoint *bp, ut64 addr, int size, int perm)
Add a software breakpoint size preferred size of the breakpoint, or 0 to determine automatically.
RZ_API int rz_bp_size_at(RZ_NONNULL RzBreakpoint *bp, ut64 addr)
Predict the software breakpoint size to use when placing a breakpoint at addr.
RZ_API bool rz_bp_plugin_add(RzBreakpoint *bp, RZ_BORROW RZ_NONNULL RzBreakpointPlugin *plugin)
RZ_API RzList * rz_bp_traptrace_new(void)
#define RZ_BP_STATIC_PLUGINS
static RzNumCalcValue expr(RzNum *, RzNumCalc *, int)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API bool rz_list_delete_data(RZ_NONNULL RzList *list, void *ptr)
Deletes an entry in the list by searching for a pointer.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
RZ_API void rz_list_purge(RZ_NONNULL RzList *list)
Empties the list without freeing the list pointer.
void * realloc(void *ptr, size_t size)
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
static void repeat(struct parse *, sopno, int, int)
#define rz_return_val_if_fail(expr, val)
#define RZ_BP_CONT_NORMAL
void(* RzListFree)(void *ptr)
#define RZ_LOG_WARN(fmtstr,...)
#define RZ_LOG_ERROR(fmtstr,...)
int(* PrintfCallback)(const char *str,...) RZ_PRINTF_CHECK(1
#define cond(bop, top, mask, flags)
Outer context of mappings/etc. in which the RzBreakpoint instance will operate in....
bool(* is_mapped)(ut64 addr, int perm, void *user)
check if the address is mapped and has the given permissions
RzBreakpointItem ** bps_idx
ut64(WINAPI *w32_GetEnabledXStateFeatures)()