aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-interp.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2012-09-18 12:09:28 +0000
committerYao Qi <yao@codesourcery.com>2012-09-18 12:09:28 +0000
commitbb25a15c8fdacbdab231bba159894942cdfece2b (patch)
treea124eea8f88e821de7fefbb8c6beb1758f3dde6b /gdb/mi/mi-interp.c
parent201b4506b3d34c274cdc5ec5ffb8f6e43fc982a9 (diff)
downloadgdb-bb25a15c8fdacbdab231bba159894942cdfece2b.zip
gdb-bb25a15c8fdacbdab231bba159894942cdfece2b.tar.gz
gdb-bb25a15c8fdacbdab231bba159894942cdfece2b.tar.bz2
gdb/doc:
* gdb.texinfo (GDB/MI Async Records): Document new MI notifications '=tsv-created' and '=tsv-deleted'. * observer.texi (GDB Observers): New observer tsv_created and tsv_deleted. gdb: * mi/mi-interp.c: Declare mi_tsv_created and mi_tsv_deleted. (mi_interpreter_init): Call observer_attach_tsv_created and observer_attach_tsv_deleted. (mi_tsv_created, mi_tsv_deleted): New. * tracepoint.c (delete_trace_state_variable): Call observer_notify_tsv_deleted. (trace_variable_command): Call observer_notify_tsv_created. (delete_trace_variable_command): Call observer_notify_tsv_deleted. (create_tsv_from_upload): Call observer_notify_tsv_created. * NEWS: Mention it. gdb/testsuite: gdb.trace/mi-tsv-changed.exp: New.
Diffstat (limited to 'gdb/mi/mi-interp.c')
-rw-r--r--gdb/mi/mi-interp.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 9537aac..5c37bc7 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -69,6 +69,8 @@ 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_tsv_created (const char *name, LONGEST value);
+static void mi_tsv_deleted (const char *name);
static void mi_breakpoint_created (struct breakpoint *b);
static void mi_breakpoint_deleted (struct breakpoint *b);
static void mi_breakpoint_modified (struct breakpoint *b);
@@ -128,6 +130,8 @@ mi_interpreter_init (struct interp *interp, int top_level)
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_tsv_created (mi_tsv_created);
+ observer_attach_tsv_deleted (mi_tsv_deleted);
observer_attach_breakpoint_created (mi_breakpoint_created);
observer_attach_breakpoint_deleted (mi_breakpoint_deleted);
observer_attach_breakpoint_modified (mi_breakpoint_modified);
@@ -537,6 +541,40 @@ mi_traceframe_changed (int tfnum, int tpnum)
gdb_flush (mi->event_channel);
}
+/* Emit notification on creating a trace state variable. */
+
+static void
+mi_tsv_created (const char *name, LONGEST value)
+{
+ struct mi_interp *mi = top_level_interpreter_data ();
+
+ target_terminal_ours ();
+
+ fprintf_unfiltered (mi->event_channel, "tsv-created,"
+ "name=\"%s\",value=\"%s\"\n",
+ name, plongest (value));
+
+ gdb_flush (mi->event_channel);
+}
+
+/* Emit notification on deleting a trace state variable. */
+
+static void
+mi_tsv_deleted (const char *name)
+{
+ struct mi_interp *mi = top_level_interpreter_data ();
+
+ target_terminal_ours ();
+
+ if (name != NULL)
+ fprintf_unfiltered (mi->event_channel, "tsv-deleted,"
+ "name=\"%s\"\n", name);
+ else
+ fprintf_unfiltered (mi->event_channel, "tsv-deleted\n");
+
+ gdb_flush (mi->event_channel);
+}
+
/* Emit notification about a created breakpoint. */
static void