]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
fbsd-nat: Add a low_delete_thread virtual method.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 22 Mar 2022 19:05:43 +0000 (12:05 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 22 Mar 2022 19:05:43 +0000 (12:05 -0700)
This method can be overridden by architecture-specific targets to
perform additional work when a thread is deleted.

Note that this method is only invoked on systems supporting LWP
events, but the pending use case (aarch64 debug registers) is not
supported on older kernels that do not support LWP events.

gdb/fbsd-nat.c
gdb/fbsd-nat.h

index 51234eaa6c92a65d4bb20d35187c4570e7c4932d..2bc7937a38bb5c4eba4cea47518d3b01954ee0dd 100644 (file)
@@ -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)
index d7c8eb81e96c8587736860219f4665983de8a9b3..6028aebfccc6bf837503a70df3000e76ac3f3604 100644 (file)
@@ -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;