aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.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/tracepoint.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/tracepoint.c')
-rw-r--r--gdb/tracepoint.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 296999b..bdd6f50 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -359,6 +359,9 @@ delete_trace_state_variable (const char *name)
{
xfree ((void *)tsv->name);
VEC_unordered_remove (tsv_s, tvariables, ix);
+
+ observer_notify_tsv_deleted (name);
+
return;
}
@@ -423,6 +426,8 @@ trace_variable_command (char *args, int from_tty)
tsv = create_trace_state_variable (internalvar_name (intvar));
tsv->initial_value = initval;
+ observer_notify_tsv_created (tsv->name, initval);
+
printf_filtered (_("Trace state variable $%s "
"created, with initial value %s.\n"),
tsv->name, plongest (tsv->initial_value));
@@ -442,6 +447,7 @@ delete_trace_variable_command (char *args, int from_tty)
if (query (_("Delete all trace state variables? ")))
VEC_free (tsv_s, tvariables);
dont_repeat ();
+ observer_notify_tsv_deleted (NULL);
return;
}
@@ -3551,6 +3557,8 @@ create_tsv_from_upload (struct uploaded_tsv *utsv)
tsv->initial_value = utsv->initial_value;
tsv->builtin = utsv->builtin;
+ observer_notify_tsv_created (tsv->name, tsv->initial_value);
+
do_cleanups (old_chain);
return tsv;