diff --git a/libr/bp/bp_watch.c b/libr/bp/bp_watch.c index ad8be554e3..c6695f63b1 100644 --- a/libr/bp/bp_watch.c +++ b/libr/bp/bp_watch.c @@ -36,16 +36,3 @@ R_API RBreakpointItem* r_bp_watch_add(RBreakpoint *bp, ut64 addr, int size, int R_API void r_bp_watch_del() { } - -/* TODO: move into _watch */ -R_API int r_bp_add_cond(struct r_bp_t *bp, const char *cond) { - // TODO: implement contitional breakpoints - bp->stepcont = true; - return 0; -} - -R_API int r_bp_del_cond(struct r_bp_t *bp, int idx) { - // add contitional - bp->stepcont = false; - return true; -} diff --git a/libr/core/cmd_debug.c b/libr/core/cmd_debug.c index 68b0c74a48..af13dbd970 100644 --- a/libr/core/cmd_debug.c +++ b/libr/core/cmd_debug.c @@ -3036,6 +3036,33 @@ static void r_core_cmd_bp(RCore *core, const char *input) { } break; case 'w': // "dbw" + if (input[2] == 'C') { // "dbwC" + if (input[3] == ' ') { + char *inp = strdup (input + 4); + if (inp) { + char *arg = strchr (inp, ' '); + if (arg) { + *arg++ = 0; + addr = r_num_math (core->num, inp); + bpi = r_bp_get_at (core->dbg->bp, addr); + if (bpi) { + free (bpi->cond); + bpi->cond = strdup (arg); + } else { + eprintf ("No breakpoint defined at 0x%08"PFMT64x"\n", addr); + } + } else { + eprintf ("1 Missing argument\n"); + } + free (inp); + } else { + eprintf ("Cannot strdup. Your heap is fucked up\n"); + } + } else { + eprintf ("Use: dbwC [addr] [command]\n"); + } + break; + } input++; // skip 'w' watch = true; // passthru