This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] New MI notification "=tsv-modified"


On 01/30/2013 03:43 PM, Yao Qi wrote:
> Hi,
> I added MI notifications "=tsv-created" and "=tsv-deleted" in this
> patch, http://sourceware.org/ml/gdb-patches/2012-09/msg00191.html
> We think it is still necessary to add another MI notification
> "=tsv-modified" for the changes of the initial value of a tsv.  This
> is what this patch does.

Should we emit a notification when GDB detects the target
changes the variable too?

> 2013-01-30  Yao Qi  <yao@codesourcery.com>
> 
> 	* mi/mi-interp.c (mi_tsv_modified): Declare.
> 	(mi_interpreter_init): Call observer_attach_tsv_modified.
> 	(mi_tsv_modified): New.
> 	* tracepoint.c (trace_variable_command): Call
> 	observer_notify_tsv_modified if the initial value of tsv is
> 	changed.
> 
> 	* NEWS: Mention the new MI notification.

Please spell out the notification.  Nothing else in the GDB
ChangeLog entry indicates what is "the new".

> 
> gdb/testsuite:
> 
> 2013-01-30  Yao Qi  <yao@codesourcery.com>
> 
> 	* gdb.trace/mi-tsv-changed.exp (test_create_delete_tsv): Rename
> 	to ...
> 	(test_create_delete_modify_tsv): New.  

It's a rename, or a new function?

> @@ -37,6 +37,9 @@ proc test_create_delete_tsv { } {with_test_prefix "create delete" {
>      mi_gdb_test "tvariable \$tvar1" \
>  	".*=tsv-created,name=\"tvar1\",value=\"0\"\\\\n.*\\^done" \
>  	"tvariable \$tvar1"
> +    mi_gdb_test "tvariable \$tvar1 = 1" \
> +	".*=tsv-modified,name=\"tvar1\",value=\"1\"\\\\n.*\\^done" \
> +	"tvariable \$tvar1 modified"

It would be thorough to test that another "tvariable \$tvar1 = 1"
_doesn't_ emit a modified notification.

>      mi_gdb_test "tvariable \$tvar2 = 45" \
>  	".*=tsv-created,name=\"tvar2\",value=\"45\"\\\\n.*\\^done" \
>  	"tvariable \$tvar2"
> @@ -81,6 +84,10 @@ proc test_upload_tsv { } { with_test_prefix "upload" {
>      gdb_test "tvariable \$tvar2 = 45" \
>  	"Trace state variable \\\$tvar2 created, with initial value 45." \
>  	"Create a trace state variable with initial value"
> +
> +    gdb_test "tvariable \$tvar3 = 1" \
> +	"Trace state variable \\\$tvar3 created, with initial value 1." \
> +	"Create a trace state variable \$tvar3 with initial value 1"

I couldn't figure out what motivated this addition.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]