Re: [PATCH] store trace default-collect to target [6/6] test

Hui Zhu
2013-04-16T09:33:02Z

[-- Attachment #1: Type: text/plain, Size: 1877 bytes --]

Hi Yao,

Thanks for your review.

On Thu, Apr 11, 2013 at 4:19 PM, Yao Qi <yao@codesourcery.com> wrote:
> On 04/11/2013 03:40 PM, Hui Zhu wrote:
>>
>> --- a/testsuite/gdb.trace/tstatus.exp
>> +++ b/testsuite/gdb.trace/tstatus.exp
>> @@ -137,6 +137,8 @@ proc test_tracepoints {} {
>>
>> test_tracepoints
>>
>> +gdb_test_no_output "set default-collect \$regs"
>> +
>> set tracefile [standard_output_file ${testfile}]
>> # Save trace frames to tfile.
>> gdb_test "tsave ${tracefile}.tf" \
>> @@ -147,6 +149,8 @@ gdb_test "tsave -ctf ${tracefile}.ctf" \
>> "Trace data saved to directory '${tracefile}.ctf'.*" \
>> "save ctf trace file"
>>
>> +gdb_test_no_output "set default-collect"
>> +
>> # Change target to tfile.
>> set test "change to tfile target"
>> gdb_test_multiple "target tfile ${tracefile}.tf" "$test" {
>> @@ -159,6 +163,8 @@ gdb_test_multiple "target tfile ${tracef
>> }
>> }
>>
>> +gdb_test "show default-collect" "The list of expressions to collect by
>> default is \"\\\$regs\".*"
>> +
>> # Convert "(because I can) to "\(because I can\)"
>> set tstatus_output [string map {\( \\(} $tstatus_output]
>> set tstatus_output [string map {\) \\)} $tstatus_output]
>
>
> I am afraid that tstatus.exp is not a good place to test "default-collect".
> The tstatus.exp is to test the output of command 'tstatus' in various
> situations, and also test that the output of 'tstatus' command on tfile
> target is identical to its output on the ctf target. Probably, actions.exp
> is better, IMO.

Move it to actions.exp

Post a new version for it.

Best,
Hui

2013-04-16 Hui Zhu <hui@codesourcery.com>

* gdb.trace/disconnected-tracing.exp (disconnected_tracing): Add
test for default-collect.
* gdb.trace/actions.exp: Add test for default-collect.

>
> --
> Yao (齐尧)

[-- Attachment #2: defc-test.txt --]
[-- Type: text/plain, Size: 1673 bytes --]

--- a/testsuite/gdb.trace/actions.exp
+++ b/testsuite/gdb.trace/actions.exp
@@ -248,6 +248,8 @@ gdb_trace_setactions "set actions for fi
"collect \$regs" "^$" \
"end" ""

+gdb_test_no_output "set default-collect \$regs"
+
# Check the definition of tracepoints. These tracepoints may have
# different number in different runs.

@@ -256,6 +258,8 @@ proc check_tracepoint { data_source } {
global gdb_prompt
global srcfile

+ gdb_test "show default-collect" "The list of expressions to collect by default is \"\\\$regs\".*"
+
set tp_on_gdb_c_test 0
set tp_on_gdb_asm_test 0
set tp_on_gdb_recursion_test 0
--- a/testsuite/gdb.trace/disconnected-tracing.exp
+++ b/testsuite/gdb.trace/disconnected-tracing.exp
@@ -65,6 +65,8 @@ proc disconnected_tracing { } {
"collect foo" "^$"
gdb_test "break end" "Breakpoint ${decimal} at .*"

+ gdb_test_no_output "set default-collect \$regs"
+
gdb_test_no_output "tstart"

gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*"
@@ -73,6 +75,8 @@ proc disconnected_tracing { } {
gdb_test "info tracepoints" ".*in start at.*" \
"first info tracepoints"

+ gdb_test_no_output "set default-collect"
+
gdb_test "disconnect" "Ending remote debugging\\." "first disconnect"
if { [gdb_reconnect] == 0 } {
pass "first reconnect after unload"
@@ -83,6 +87,8 @@ proc disconnected_tracing { } {
gdb_test "info tracepoints" ".*in start at.*" \
"second info tracepoints"

+ gdb_test "show default-collect" "The list of expressions to collect by default is \"\\\$regs\".*"
+
delete_breakpoints
gdb_test "info tracepoints" ".*No tracepoints..*" \
"third info tracepoints"