aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-11-17 12:28:05 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-11-17 12:28:05 +0000
commit4a92f99bc7076bebcee009e8b2a7fc717df03590 (patch)
tree67b5ccbd4bc7353ad54d046c61689598295c70a4 /gdb/mi
parent3ee1c036ac61c61fc906fc93eb63fe625cacaa55 (diff)
downloadgdb-4a92f99bc7076bebcee009e8b2a7fc717df03590.zip
gdb-4a92f99bc7076bebcee009e8b2a7fc717df03590.tar.gz
gdb-4a92f99bc7076bebcee009e8b2a7fc717df03590.tar.bz2
Notification for attach/detach.
* inferior.c: Call the process observers. * mi/mi-interp.c (mi_new_inferior, mi_inferior_exit): New. (mi_interpreter_init): Register the above.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-interp.c24
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,