summaryrefslogtreecommitdiffstats
path: root/debugger.c
diff options
context:
space:
mode:
Diffstat (limited to 'debugger.c')
-rw-r--r--debugger.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/debugger.c b/debugger.c
index 1ad88c8..73db856 100644
--- a/debugger.c
+++ b/debugger.c
@@ -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);
}
}