From 3a8bf604bf4d086bdc4fee70a82371a338835222 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 7 Oct 2023 02:02:44 -0400 Subject: Fix bug with cleaning temporary breakpoints dont remove them before initial use Signed-off-by: Malfurious --- debugger.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/debugger.c b/debugger.c index a1ff940..b08faf6 100644 --- a/debugger.c +++ b/debugger.c @@ -87,15 +87,16 @@ static void uninstall_breakpoints(struct thread *th) { if (b->installed) { ptrace(PTRACE_POKETEXT, th->id, b->address, b->text); b->installed = 0; - } - if (b->enabled < 0) { - struct thread *t; - if (b->tid == 0 || - ((t = thread_by_id(th->proc, b->tid)) && !t->shouldcont)) { - struct breakpoint *del = b; - b = b->next; - list_remove(del); - free(del); + + if (b->enabled < 0) { + struct thread *t; + if (b->tid == 0 || + ((t = thread_by_id(th->proc, b->tid)) && !t->doing)) { + struct breakpoint *del = b; + b = b->next; + list_remove(del); + free(del); + } } } } -- cgit v1.2.3