diff options
author | Malfurious <m@lfurio.us> | 2023-09-25 14:46:34 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2024-04-24 13:31:08 -0400 |
commit | 6a9e590b847a034d190fe3c89ef37656073d229a (patch) | |
tree | 09db1fab21bcd3ddfef4bb09e60cff99953ea671 /debugger.c | |
parent | c5211aca9ea40487dc4299423f735da04630fcc6 (diff) | |
download | misplays-6a9e590b847a034d190fe3c89ef37656073d229a.tar.gz misplays-6a9e590b847a034d190fe3c89ef37656073d229a.zip |
Don't drop temporary breakpoints when execution is to be restarted
Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'debugger.c')
-rw-r--r-- | debugger.c | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -51,14 +51,14 @@ static int detect_breakpoint(struct thread *th) { } } - /* this needs moved, we have to finish the for-loop - * to actually know if restart is true or false... */ - if (b->enabled < 0 && !restart) { - struct breakpoint *del = b; - b = b->prev; - list_remove(del); - free(del); - } + ///* this needs moved, we have to finish the for-loop + // * to actually know if restart is true or false... */ + //if (b->enabled < 0 && !restart) { + // struct breakpoint *del = b; + // b = b->prev; + // list_remove(del); + // free(del); + //} } } @@ -87,6 +87,13 @@ static void uninstall_breakpoints(struct process *proc) { ptrace(PTRACE_POKETEXT, proc->id, b->address, b->text); b->installed = 0; } + + if (b->enabled < 0) { + struct breakpoint *del = b; + b = b->next; + list_remove(del); + free(del); + } } } @@ -431,8 +438,8 @@ int dbg_wait(struct thread *th, int recursion) { if (!recursion) { stopped = interrupt_all_threads(th->proc); - uninstall_breakpoints(th->proc); if (!restart) { + uninstall_breakpoints(th->proc); capture_state(th, stopped); } } |