From 95364d5a74eb9977b946b4a520eb2624f2c788ab Mon Sep 17 00:00:00 2001 From: Matt Hunter Date: Tue, 2 Sep 2025 19:14:33 -0400 Subject: 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 --- debugger.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debugger.c') 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; -- cgit v1.2.3