mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
gdb/doc:
2013-02-06 Yao Qi <yao@codesourcery.com> * gdb.texinfo (GDB/MI Async Records): Document new MI notification "=tsv-modified". Update the document of MI notification "=tsv-created". * observer.texi (GDB Observers): New observer tsv_modified. Update observer tsv_created and tsv_deleted. gdb: 2013-02-06 Yao Qi <yao@codesourcery.com> * mi/mi-interp.c: Include "tracepoint.h". (mi_tsv_modified): Declare. (mi_tsv_created, mi_tsv_deleted): Update declaration. (mi_interpreter_init): Call observer_attach_tsv_modified. (mi_tsv_modified): New. (mi_tsv_created, mi_tsv_deleted): Update. * tracepoint.c (trace_variable_command): Call observer_notify_tsv_modified if the initial value of tsv is changed. (delete_trace_state_variable): Call observer_notify_tsv_deleted earlier. (trace_variable_command): Caller update. (create_tsv_from_upload): Likewise. * observer.sh: Declare "struct trace_state_variable". * NEWS: Mention the new MI notification "=tsv-modified". gdb/testsuite: 2013-02-06 Yao Qi <yao@codesourcery.com> * gdb.trace/mi-tsv-changed.exp (test_create_delete_tsv): Rename to ... (test_create_delete_modify_tsv): ... here. New test on modifying the initial value of a tsv.
This commit is contained in:
@@ -351,11 +351,11 @@ delete_trace_state_variable (const char *name)
|
||||
for (ix = 0; VEC_iterate (tsv_s, tvariables, ix, tsv); ++ix)
|
||||
if (strcmp (name, tsv->name) == 0)
|
||||
{
|
||||
observer_notify_tsv_deleted (tsv);
|
||||
|
||||
xfree ((void *)tsv->name);
|
||||
VEC_unordered_remove (tsv_s, tvariables, ix);
|
||||
|
||||
observer_notify_tsv_deleted (name);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -408,7 +408,11 @@ trace_variable_command (char *args, int from_tty)
|
||||
tsv = find_trace_state_variable (internalvar_name (intvar));
|
||||
if (tsv)
|
||||
{
|
||||
tsv->initial_value = initval;
|
||||
if (tsv->initial_value != initval)
|
||||
{
|
||||
tsv->initial_value = initval;
|
||||
observer_notify_tsv_modified (tsv);
|
||||
}
|
||||
printf_filtered (_("Trace state variable $%s "
|
||||
"now has initial value %s.\n"),
|
||||
tsv->name, plongest (tsv->initial_value));
|
||||
@@ -420,7 +424,7 @@ 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);
|
||||
observer_notify_tsv_created (tsv);
|
||||
|
||||
printf_filtered (_("Trace state variable $%s "
|
||||
"created, with initial value %s.\n"),
|
||||
@@ -3587,7 +3591,7 @@ 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);
|
||||
observer_notify_tsv_created (tsv);
|
||||
|
||||
do_cleanups (old_chain);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user