esil emulation now stops at breakpoints (#10834)

This commit is contained in:
fcasal 2018-07-27 20:01:38 +01:00 committed by radare
parent e57fdba049
commit 9a83761c6d
2 changed files with 11 additions and 6 deletions

View File

@ -3377,10 +3377,15 @@ repeat:
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 File

@ -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 */