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

Hui Zhu
2013-04-11T07:40:43Z

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

On 04/11/13 15:30, Yao Qi wrote:
> On 04/11/2013 02:19 PM, Hui Zhu wrote:
>> This patch add test about default-collect to disconnected-tracing.exp for remote and tstatus.exp for tfile.
>>
>> I test them with:
>> make check RUNTESTFLAGS="--target_board=native-gdbserver disconnected-tracing.exp tstatus.exp"
>
> Hui,
> You attached the wrong patch in the mail.
>

Oops. post the right one.

Thanks,
Hui

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

--- 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"
--- 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]