Re: [PATCH v3 13/15] Test on saving tracepoint defs.

Tom Tromey
2013-03-12T20:10:52Z

>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> 2013-03-08 Yao Qi <yao@codesourcery.com>

Yao> * gdb.trace/actions.exp (check_tracepoint): New.
Yao> (top level): Start the tracing and check the actions of
Yao> tracepoints. Save trace data to tfile format. Restart GDB
Yao> and read trace file in tfile target. Check the actions of
Yao> tracepoints again.
Yao> * gdb.trace/while-stepping.exp: Likewise.

Yao> +gdb_test "break main"
Yao> +gdb_run_cmd
Yao> +gdb_test "" "Breakpoint .*"

I'd prefer some refactoring of gdb_run_cmd or runto instead.
gdb_test with an empty argument has always struck me as iffy.

Yao> +if ![gdb_target_supports_trace] {
Yao> + unsupported "target does not support trace"
Yao> + return -1;

No semicolon.

Yao> +gdb_test "tsave ${testfile}.tf" \
Yao> + "Trace data saved to file '${testfile}.tf'\.\\r"

Would you mind using standard_output_file?

Yao> +# Restart GDB and read the trace data in tfile target.
Yao> +gdb_exit
Yao> +gdb_start
Yao> +gdb_reinitialize_dir $srcdir/$subdir
Yao> +gdb_file_cmd $binfile

clean_restart?

Yao> +gdb_test "break main"
Yao> +gdb_run_cmd
Yao> +gdb_test "" "Breakpoint .*"
Yao> +if ![gdb_target_supports_trace] {
Yao> + unsupported "target does not support trace"
Yao> + return -1;
Yao> +}

Same comments here.

Yao> +proc check_tracepoint { data_source } { with_test_prefix "$data_source" {

Formatting of with_test_prefix.
(I forgot to mention it, but same in the other file.)

Yao> +# Restart GDB and read the trace data in tfile target.
Yao> +gdb_exit
Yao> +gdb_start
Yao> +gdb_reinitialize_dir $srcdir/$subdir
Yao> +gdb_file_cmd $binfile

clean_restart?

Yao> +gdb_test "target tfile ${testfile}.tf" ".*" \
Yao> + "change to tfile target"

standard_output_file

Tom