summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2023-09-25 14:46:34 -0400
committerMalfurious <m@lfurio.us>2024-04-24 13:31:08 -0400
commit6a9e590b847a034d190fe3c89ef37656073d229a (patch)
tree09db1fab21bcd3ddfef4bb09e60cff99953ea671
parentc5211aca9ea40487dc4299423f735da04630fcc6 (diff)
downloadmisplays-6a9e590b847a034d190fe3c89ef37656073d229a.tar.gz
misplays-6a9e590b847a034d190fe3c89ef37656073d229a.zip
Don't drop temporary breakpoints when execution is to be restarted
Signed-off-by: Malfurious <m@lfurio.us>
-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);
}
}