summaryrefslogtreecommitdiff
path: root/devel/gdb/files/commit-983b1119bc3
blob: 8d510809f0f1d592a13847a3a9557deec460f6dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
commit 1371da3a2d71dbd58f5ba3dd3c39841f0182556d
Author: John Baldwin <jhb@FreeBSD.org>
Date:   Tue Mar 22 12:05:43 2022 -0700

    fbsd-nat: Add a low_delete_thread virtual method.
    
    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.
    
    (cherry picked from commit 983b1119bc315c9182e3aba898ca8099e54da49e)

diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
index 51234eaa6c9..2bc7937a38b 100644
--- gdb/fbsd-nat.c
+++ 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 gdb/fbsd-nat.h gdb/fbsd-nat.h
index d7c8eb81e96..6028aebfccc 100644
--- gdb/fbsd-nat.h
+++ gdb/fbsd-nat.h
@@ -115,6 +115,10 @@ class fbsd_nat_target : public inf_ptrace_target
   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;