diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index 51234eaa6c9..2bc7937a38b 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -1293,6 +1293,7 @@ fbsd_nat_target::wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus, if (print_thread_events) printf_unfiltered (_("[%s exited]\n"), target_pid_to_str (wptid).c_str ()); + low_delete_thread (thr); delete_thread (thr); } if (ptrace (PT_CONTINUE, pid, (caddr_t) 1, 0) == -1) diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h index d7c8eb81e96..6028aebfccc 100644 --- a/gdb/fbsd-nat.h +++ b/gdb/fbsd-nat.h @@ -115,6 +115,10 @@ public: virtual void low_new_fork (ptid_t parent, pid_t child) {} + /* The method to call, if any, when a thread is destroyed. */ + virtual void low_delete_thread (thread_info *) + {} + protected: void post_startup_inferior (ptid_t) override;