mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-03 12:12:06 +00:00
29c2670039
When resuming after (during) recoil from a breakpoint, the swstep implementation would fail to advance. In short, the debugger would immediately interrupt again because r_bp_restore was re-setting the original breakpoint just before continue. The following changes fix this issue: 1. Modify r_bp_get_in to stop including the byte after a breakpoint. This was causing r_bp_recoil to fail because it thought there was already a breakpoint on the next instruction. 2. Pass the real breakpoint address (pc - dbg->bpsize) to r_bp_recoil so that r_bp_get_in can work properly. Stop adding the b->size there to keep it going too. 3. Add a state flag to core->dbg to track that we are in the midst of a recoil. 4. When continuing from recoil (in r_debug_continue_kill), restore all breakpoints except the one we just hit (with the new r_bp_restore_except) to avoid hitting it again. Once we move past this instruction, that breakpoint will be set again.