aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-interp.c
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-05-03 15:10:42 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-05-03 15:10:42 +0000
commit063bfe2e12756ad30f4b4edb81974c0e4bd4299d (patch)
tree16adac2c33c56cb2c3fdd33e2c2e26851d195348 /gdb/mi/mi-interp.c
parent9cbdce76abdea25d9447f42b498c2ecdf5bc9a34 (diff)
downloadgdb-063bfe2e12756ad30f4b4edb81974c0e4bd4299d.zip
gdb-063bfe2e12756ad30f4b4edb81974c0e4bd4299d.tar.gz
gdb-063bfe2e12756ad30f4b4edb81974c0e4bd4299d.tar.bz2
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.
Diffstat (limited to 'gdb/mi/mi-interp.c')
-rw-r--r--gdb/mi/mi-interp.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 146d875..8b0d909 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -67,6 +67,7 @@ static void mi_insert_notify_hooks (void);
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)
@@ -88,7 +89,10 @@ 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;
}
@@ -317,6 +321,16 @@ mi_new_thread (struct thread_info *t)
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