diff options
author | Matt Hunter <m@lfurio.us> | 2025-09-02 19:14:33 -0400 |
---|---|---|
committer | Matt Hunter <m@lfurio.us> | 2025-09-07 21:03:26 -0400 |
commit | 95364d5a74eb9977b946b4a520eb2624f2c788ab (patch) | |
tree | 8d9c2c80f9e1aa94a8acf421472192f53adc6ed2 | |
parent | 9640f4b82b1030378bbf5e81ce205d0096cc6b73 (diff) | |
download | misplays-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>
-rw-r--r-- | debugger.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |