aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-interp.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2012-09-18 11:33:43 +0000
committerYao Qi <yao@codesourcery.com>2012-09-18 11:33:43 +0000
commit201b4506b3d34c274cdc5ec5ffb8f6e43fc982a9 (patch)
tree3315adad7b15dc81c715d0e28da3778dbde9e49c /gdb/mi/mi-interp.c
parentfbdc86d9c9e5fe451861a34381bf5483aec43bf1 (diff)
downloadgdb-201b4506b3d34c274cdc5ec5ffb8f6e43fc982a9.zip
gdb-201b4506b3d34c274cdc5ec5ffb8f6e43fc982a9.tar.gz
gdb-201b4506b3d34c274cdc5ec5ffb8f6e43fc982a9.tar.bz2
gdb/doc:
* observer.texi (GDB Observers): New observer 'traceframe_changed'. * gdb.texinfo (GDB/MI Async Records): Mention new MI notification '=traceframe-changed'. gdb: * tracepoint.c (tfind_1): Call observer_notify_traceframe_changed if traceframe changed. * mi/mi-cmds.c (mi_cmd mi_cmds): Adjust for command "trace-find". * mi/mi-interp.c: Declare 'mi_traceframe_changed'. (mi_interpreter_init): Hook mi_traceframe_changed to observer 'traceframe_changed'. (mi_traceframe_changed): New. * mi/mi-main.h (struct mi_suppress_notification) <traceframe>: New field. * NEWS: Mention the new MI notification. gdb/testsuite: * gdb.trace/mi-traceframe-changed.exp: New.
Diffstat (limited to 'gdb/mi/mi-interp.c')
-rw-r--r--gdb/mi/mi-interp.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 94df818..9537aac 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -68,6 +68,7 @@ static void mi_on_resume (ptid_t ptid);
static void mi_solib_loaded (struct so_list *solib);
static void mi_solib_unloaded (struct so_list *solib);
static void mi_about_to_proceed (void);
+static void mi_traceframe_changed (int tfnum, int tpnum);
static void mi_breakpoint_created (struct breakpoint *b);
static void mi_breakpoint_deleted (struct breakpoint *b);
static void mi_breakpoint_modified (struct breakpoint *b);
@@ -126,6 +127,7 @@ mi_interpreter_init (struct interp *interp, int top_level)
observer_attach_solib_loaded (mi_solib_loaded);
observer_attach_solib_unloaded (mi_solib_unloaded);
observer_attach_about_to_proceed (mi_about_to_proceed);
+ observer_attach_traceframe_changed (mi_traceframe_changed);
observer_attach_breakpoint_created (mi_breakpoint_created);
observer_attach_breakpoint_deleted (mi_breakpoint_deleted);
observer_attach_breakpoint_modified (mi_breakpoint_modified);
@@ -510,8 +512,31 @@ struct mi_suppress_notification mi_suppress_notification =
{
0,
0,
+ 0,
};
+/* Emit notification on changing a traceframe. */
+
+static void
+mi_traceframe_changed (int tfnum, int tpnum)
+{
+ struct mi_interp *mi = top_level_interpreter_data ();
+
+ if (mi_suppress_notification.traceframe)
+ return;
+
+ target_terminal_ours ();
+
+ if (tfnum >= 0)
+ fprintf_unfiltered (mi->event_channel, "traceframe-changed,"
+ "num=\"%d\",tracepoint=\"%d\"\n",
+ tfnum, tpnum);
+ else
+ fprintf_unfiltered (mi->event_channel, "traceframe-changed,end");
+
+ gdb_flush (mi->event_channel);
+}
+
/* Emit notification about a created breakpoint. */
static void