summaryrefslogtreecommitdiffstats
path: root/debugger.c
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2023-10-07 02:02:44 -0400
committerMalfurious <m@lfurio.us>2024-04-24 13:31:08 -0400
commit3a8bf604bf4d086bdc4fee70a82371a338835222 (patch)
treee6658479925d4583ae0b88c7bef0fb8c4c8df240 /debugger.c
parent66db439988aa07828593aac109f5690bb48f2dc9 (diff)
downloadmisplays-3a8bf604bf4d086bdc4fee70a82371a338835222.tar.gz
misplays-3a8bf604bf4d086bdc4fee70a82371a338835222.zip
Fix bug with cleaning temporary breakpoints
dont remove them before initial use Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'debugger.c')
-rw-r--r--debugger.c19
1 files 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);
+ }
}
}
}