From 8e7af8434581e325366c8ec4a30f33e8e1794310 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 21 Apr 2023 09:45:30 -0400 Subject: gdb: add interp::on_thread_exited method Same idea as previous patches, but for thread_exited. Change-Id: I4be974cbe58cf635453fef503c2d77c82522cbd9 --- gdb/thread.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gdb/thread.c') diff --git a/gdb/thread.c b/gdb/thread.c index 223ba1d..b7b5d9f 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -191,6 +191,15 @@ clear_thread_inferior_resources (struct thread_info *tp) clear_inline_frame_state (tp); } +/* Notify interpreters and observers that thread T has exited. */ + +static void +notify_thread_exited (thread_info *t, int silent) +{ + interps_notify_thread_exited (t, silent); + gdb::observers::thread_exit.notify (t, silent); +} + /* See gdbthread.h. */ void @@ -213,7 +222,7 @@ set_thread_exited (thread_info *tp, bool silent) if (proc_target != nullptr) proc_target->maybe_remove_resumed_with_pending_wait_status (tp); - gdb::observers::thread_exit.notify (tp, silent); + notify_thread_exited (tp, silent); /* Tag it as exited. */ tp->state = THREAD_EXITED; -- cgit v1.1