Permalink
Browse files

esil emulation now stops at breakpoints (#10834)

  • Loading branch information...
fcasal authored and radare committed Jul 27, 2018
1 parent e57fdba commit 9a83761c6df6c483160e6c1ec43c4a50b36f64e2
Showing with 11 additions and 6 deletions.
  1. +7 −2 libr/core/cmd_anal.c
  2. +4 −4 libr/debug/debug.c
View
@@ -3377,10 +3377,15 @@ R_API int r_core_esil_step(RCore *core, ut64 until_addr, const char *until_expr,
r_core_cmd0 (core, "sr PC");
}
}
// check breakpoints
ut64 pc = r_reg_getv (core->anal->reg, name);
if (r_bp_get_at (core->dbg->bp, pc)) {
r_cons_printf ("[ESIL] hit breakpoint at 0x%"PFMT64x "\n", pc);
return_tail (0);
}
// check addr
if (until_addr != UT64_MAX) {
if (r_reg_getv (core->anal->reg, name) == until_addr) {
if (pc == until_addr) {
return_tail (0);
}
goto repeat;
View
@@ -111,22 +111,22 @@ static int r_debug_bp_hit(RDebug *dbg, RRegItem *pc_ri, ut64 pc, RBreakpointItem
dbg->pc_at_bp = false;
}
}
if (!dbg->pc_at_bp_set) {
eprintf ("failed to determine position of pc after breakpoint");
}
if (dbg->pc_at_bp) {
pc_off = 0;
b = r_bp_get_at (dbg->bp, pc);
} else {
b = r_bp_get_at (dbg->bp, pc - dbg->bpsize);
}
if (!b) {
return true;
}
b = r_bp_get_at (dbg->bp, pc - dbg->bpsize);
if (!b) { /* we don't. nothing left to do */
/* Some targets set pc to breakpoint */

0 comments on commit 9a83761

Please sign in to comment.