summaryrefslogtreecommitdiffstats
path: root/debugger.c
diff options
context:
space:
mode:
authorMatt Hunter <m@lfurio.us>2025-09-02 19:14:33 -0400
committerMatt Hunter <m@lfurio.us>2025-09-07 21:03:26 -0400
commit95364d5a74eb9977b946b4a520eb2624f2c788ab (patch)
tree8d9c2c80f9e1aa94a8acf421472192f53adc6ed2 /debugger.c
parent9640f4b82b1030378bbf5e81ce205d0096cc6b73 (diff)
downloadmisplays-95364d5a74eb9977b946b4a520eb2624f2c788ab.tar.gz
misplays-95364d5a74eb9977b946b4a520eb2624f2c788ab.zip
Discard breakpoint list on process execve
On exec, the program image and address space completely changes, so any previously established breakpoints going forward are meaningless. Even if we are re-execing the same actual program, ASLR may invalidate the addresses of BPs, let alone if the program is modified/recompiled. The act of performing the exec already "uninstalls" any breakpoints by reloading the memory space, adapt to this by simply freeing our list of managed breakpoints from the debugger, without any additional processing. Signed-off-by: Matt Hunter <m@lfurio.us>
Diffstat (limited to 'debugger.c')
-rw-r--r--debugger.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/debugger.c b/debugger.c
index 33bdbc0..7378298 100644
--- a/debugger.c
+++ b/debugger.c
@@ -412,6 +412,8 @@ static int wait_thread(struct thread *th) {
strcpy(eventth->status, "EXITED");
}
+ free_breakpoints(th->proc);
+
th->stopped = 1;
th->signal = 0;
th->doing = 0;