diff options
-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); } } |