diff options
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-interp.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index df0d3df..3121604 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -69,6 +69,8 @@ static void mi_on_normal_stop (struct bpstats *bs); static void mi_new_thread (struct thread_info *t); static void mi_thread_exit (struct thread_info *t); +static void mi_new_inferior (int pid); +static void mi_inferior_exit (int pid); static void mi_on_resume (ptid_t ptid); static void * @@ -94,6 +96,8 @@ mi_interpreter_init (int top_level) { observer_attach_new_thread (mi_new_thread); observer_attach_thread_exit (mi_thread_exit); + observer_attach_new_inferior (mi_new_inferior); + observer_attach_inferior_exit (mi_inferior_exit); observer_attach_normal_stop (mi_on_normal_stop); observer_attach_target_resumed (mi_on_resume); } @@ -303,6 +307,26 @@ mi_thread_exit (struct thread_info *t) } static void +mi_new_inferior (int pid) +{ + struct mi_interp *mi = top_level_interpreter_data (); + target_terminal_ours (); + fprintf_unfiltered (mi->event_channel, "thread-group-created,id=\"%d\"", + pid); + gdb_flush (mi->event_channel); +} + +static void +mi_inferior_exit (int pid) +{ + struct mi_interp *mi = top_level_interpreter_data (); + target_terminal_ours (); + fprintf_unfiltered (mi->event_channel, "thread-group-exited,id=\"%d\"", + pid); + gdb_flush (mi->event_channel); +} + +static void mi_on_normal_stop (struct bpstats *bs) { /* Since this can be called when CLI command is executing, |