aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-interp.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2012-09-21 01:46:46 +0000
committerYao Qi <yao@codesourcery.com>2012-09-21 01:46:46 +0000
commit82a90ccf2a55f1cdd4266e638a442bb07df6235f (patch)
tree8033a64b459af875a3c968054f8cbb8ddcaea450 /gdb/mi/mi-interp.c
parent27755b66789bfeb0b1935c66e45cf2624f8ca1bb (diff)
downloadfsf-binutils-gdb-82a90ccf2a55f1cdd4266e638a442bb07df6235f.zip
fsf-binutils-gdb-82a90ccf2a55f1cdd4266e638a442bb07df6235f.tar.gz
fsf-binutils-gdb-82a90ccf2a55f1cdd4266e638a442bb07df6235f.tar.bz2
gdb/doc:
2012-09-21 Yao Qi <yao@codesourcery.com> Pedro Alves <palves@redhat.com> * gdb.texinfo (GDB/MI Async Records): Document notification 'record-started' and 'record-stopped'. * observer.texi (GDB Observers): New observer 'record-changed'. gdb: 2012-09-21 Yao Qi <yao@codesourcery.com> * mi/mi-interp.c: Declare mi_record_changed. (mi_interpreter_init): Call observer_attach_record_changed. (mi_record_changed): New. * record.c (record_open): Call observer_notify_record_changed. (cmd_record_stop): Call observer_notify_record_changed. * NEWS: Mention it. gdb/testsuite: 2012-09-21 Yao Qi <yao@codesourcery.com> * gdb.mi/mi-record-changed.exp: New. * gdb.mi/mi-reverse.exp: Adjust expected output.
Diffstat (limited to 'gdb/mi/mi-interp.c')
-rw-r--r--gdb/mi/mi-interp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 5c37bc7..d383958 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -60,6 +60,7 @@ static void mi_on_normal_stop (struct bpstats *bs, int print_frame);
static void mi_new_thread (struct thread_info *t);
static void mi_thread_exit (struct thread_info *t, int silent);
+static void mi_record_changed (struct inferior*, int);
static void mi_inferior_added (struct inferior *inf);
static void mi_inferior_appeared (struct inferior *inf);
static void mi_inferior_exit (struct inferior *inf);
@@ -124,6 +125,7 @@ mi_interpreter_init (struct interp *interp, int top_level)
observer_attach_inferior_appeared (mi_inferior_appeared);
observer_attach_inferior_exit (mi_inferior_exit);
observer_attach_inferior_removed (mi_inferior_removed);
+ observer_attach_record_changed (mi_record_changed);
observer_attach_normal_stop (mi_on_normal_stop);
observer_attach_target_resumed (mi_on_resume);
observer_attach_solib_loaded (mi_solib_loaded);
@@ -381,6 +383,19 @@ mi_thread_exit (struct thread_info *t, int silent)
gdb_flush (mi->event_channel);
}
+/* Emit notification on changing the state of record. */
+
+static void
+mi_record_changed (struct inferior *inferior, int started)
+{
+ struct mi_interp *mi = top_level_interpreter_data ();
+
+ fprintf_unfiltered (mi->event_channel, "record-%s,thread-group=\"i%d\"",
+ started ? "started" : "stopped", inferior->num);
+
+ gdb_flush (mi->event_channel);
+}
+
static void
mi_inferior_added (struct inferior *inf)
{