+2008-05-03 Pedro Alves <pedro@codesourcery.com>
+
+ * thread.c (delete_thread): Call observer_notify_thread_exit.
+ * mi/mi-interp.c (mi_interpreter_init): Register mi_thread_exit as
+ thread_exit observer.
+ (mi_thread_exit): New.
+
2008-05-03 Thiago Jung Bauermann <bauerman@br.ibm.com>
* breakpoint.c (create_exception_catchpoint): Remove prototype
+2008-05-03 Pedro Alves <pedro@codesourcery.com>
+
+ * observer.texi (thread_exit): New.
+
2008-05-02 Pedro Alves <pedro@codesourcery.com>
* gdb.texinfo (Debugging Output): Document "set/show debug
The thread specified by @var{t} has been created.
@end deftypefun
+@deftypefun void thread_exit (struct thread_info *@var{t})
+The thread specified by @var{t} has exited.
+@end deftypefun
+
static void
exit_lwp (struct lwp_info *lp)
{
- if (in_thread_list (lp->ptid))
+ struct thread_info *th = find_thread_pid (lp->ptid);
+
+ if (th)
{
if (print_thread_events)
printf_unfiltered (_("[%s exited]\n"), target_pid_to_str (lp->ptid));
static void mi_remove_notify_hooks (void);
static void mi_new_thread (struct thread_info *t);
+static void mi_thread_exit (struct thread_info *t);
static void *
mi_interpreter_init (int top_level)
mi->event_channel = mi_console_file_new (raw_stdout, "=", 0);
if (top_level)
- observer_attach_new_thread (mi_new_thread);
+ {
+ observer_attach_new_thread (mi_new_thread);
+ observer_attach_thread_exit (mi_thread_exit);
+ }
return mi;
}
gdb_flush (mi->event_channel);
}
+static void
+mi_thread_exit (struct thread_info *t)
+{
+ struct mi_interp *mi = top_level_interpreter_data ();
+
+ target_terminal_ours ();
+ fprintf_unfiltered (mi->event_channel, "thread-exited,id=\"%d\"", t->num);
+ gdb_flush (mi->event_channel);
+}
+
extern initialize_file_ftype _initialize_mi_interp; /* -Wmissing-prototypes */
void