* [RFA] gdb.trace/*.exp send_gdb vs. gdb_test
@ 2010-05-27 18:22 Michael Snyder
2010-05-27 18:44 ` Pedro Alves
0 siblings, 1 reply; 10+ messages in thread
From: Michael Snyder @ 2010-05-27 18:22 UTC (permalink / raw)
To: gdb-patches, Pedro Alves, Stan Shebs
[-- Attachment #1: Type: text/plain, Size: 149 bytes --]
This patch should get extra-thorough review and preferably be tested by
the tracepoint maintainers, since I wasn't able to test all of it.
Michael
[-- Attachment #2: trace.exp.txt --]
[-- Type: text/plain, Size: 24697 bytes --]
2010-05-26 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
* gdb.trace/actions.exp: Replace uses of send_gdb / gdb_expect.
* gdb.trace/backtrace.exp: Replace uses of send_gdb / gdb_expect.
* gdb.trace/collection.exp: Replace uses of send_gdb / gdb_expect.
* gdb.trace/deltrace.exp: Replace uses of send_gdb / gdb_expect.
* gdb.trace/infotrace.exp: Replace uses of send_gdb / gdb_expect.
* gdb.trace/limits.exp: Replace uses of send_gdb / gdb_expect.
* gdb.trace/report.exp: Replace uses of send_gdb / gdb_expect.
* gdb.trace/save-trace.exp: Replace uses of send_gdb / gdb_expect.
* gdb.trace/tfind.exp: Replace uses of send_gdb / gdb_expect.
* gdb.trace/tracecmd.exp: Replace uses of send_gdb / gdb_expect.
* gdb.trace/tsv.exp: Replace uses of send_gdb / gdb_expect.
Index: actions.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/actions.exp,v
retrieving revision 1.19
diff -u -p -r1.19 actions.exp
--- actions.exp 5 May 2010 18:07:03 -0000 1.19
+++ actions.exp 27 May 2010 18:16:17 -0000
@@ -66,8 +66,7 @@ if { $trcpt1 <= 0 || $trcpt2 <= 0 || $tr
# 5.1 actions of specified tracepoint
-send_gdb "info tracepoints\n"
-gdb_expect {
+gdb_test_multiple "info tracepoints" "5.1a: set three tracepoints, no actions" {
-re "Actions for tracepoint \[0-9\]+:.*$gdb_prompt $" {
fail "5.1a: testsuite failure (tracepoint already has action)!"
}
@@ -148,8 +147,7 @@ gdb_test "end" "This command cannot be u
gdb_trace_setactions "5.5a: set empty actions for first tracepoint" \
"$trcpt1"
-send_gdb "info tracepoints\n"
-gdb_expect {
+gdb_test_multiple "info tracepoints" "5.5c: verify NO actions for first tracepoint" {
-re "No tracepoints.*$gdb_prompt $" {
fail "5.5c: verify NO actions for first tracepoint"
}
Index: backtrace.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/backtrace.exp,v
retrieving revision 1.15
diff -u -p -r1.15 backtrace.exp
--- backtrace.exp 5 May 2010 18:07:04 -0000 1.15
+++ backtrace.exp 27 May 2010 18:16:17 -0000
@@ -71,8 +71,7 @@ if { $baseline == -1 } {
return;
}
-send_gdb "list $baseline, +12\n"
-gdb_expect {
+gdb_test_multiple "list $baseline, +12" "all tests in this module will fail" {
-re "\[\r\n\](\[0-9\]+).*gdbtestline 1 " {
set testline1 $expect_out(1,string)
exp_continue
@@ -108,7 +107,7 @@ all tests in this module will fail."
untested backtrace.exp
return -1
all tests in this module will fail."
- }
+ }
}
#
@@ -177,16 +176,9 @@ proc gdb_backtrace_tdp_1 { msg } {
# to be able to display the function's arguments or locals, and we
# do not expect to be able to identify the caller of this function.
- send_gdb "backtrace\n"
- gdb_expect {
- -re "#0\[\t \]+gdb_recursion_test.*depth=.*$gdb_prompt $" {
- pass "$msg"
- }
- -re ".*$gdb_prompt $" {
- fail "$msg"
- }
- timeout { fail "$msg (timeout)" }
- }
+ gdb_test "backtrace" \
+ "#0\[\t \]+gdb_recursion_test.*depth=.*" \
+ "$msg"
}
proc gdb_backtrace_tdp_2 { msg } {
@@ -198,16 +190,9 @@ proc gdb_backtrace_tdp_2 { msg } {
# passed in registers (which isn't the case for m68k), and we
# don't expect to be able to identify the caller's stack frame.
- send_gdb "backtrace\n"
- gdb_expect {
- -re "#0\[\t \]+gdb_recursion_test.*depth=.*$gdb_prompt $" {
- pass "$msg"
- }
- -re ".*$gdb_prompt $" {
- fail "$msg"
- }
- timeout { fail "$msg (timeout)" }
- }
+ gdb_test "backtrace" \
+ "#0\[\t \]+gdb_recursion_test.*depth=.*" \
+ "$msg"
}
proc gdb_backtrace_tdp_3 { msg } {
@@ -217,18 +202,13 @@ proc gdb_backtrace_tdp_3 { msg } {
# arguments and all locals. This means that the display of
# stack frame #0 should be complete (including argument values).
- send_gdb "backtrace\n"
- gdb_expect {
+ gdb_test_multiple "backtrace" "$msg" {
-re "#0\[\t \]+gdb_recursion_test.*depth=\[0-9\]+.*q1=\[0-9\]+.*q2=\[0-9\]+.*q3=\[0-9\]+.*q4=\[0-9\]+.*q5=\[0-9\]+.*q6=\[0-9\]+.*$gdb_prompt $" {
pass "$msg"
}
-re "#0\[\t \]+gdb_recursion_test.*depth=Cannot access.*$gdb_prompt $" {
fail "$msg (failed to collect arguments)"
}
- -re ".*$gdb_prompt $" {
- fail "$msg"
- }
- timeout { fail "$msg (timeout)" }
}
}
@@ -241,8 +221,7 @@ proc gdb_backtrace_tdp_4 { msg depth } {
# assume that if we can't display at least "depth" levels (with
# args), it counts as an error.
- send_gdb "backtrace\n"
- gdb_expect {
+ gdb_test_multiple "backtrace" "$msg" {
-re "#$depth\[\t \].*gdb_recursion_test.*depth=\[0-9\]+.*q1=\[0-9\]+.*q2=\[0-9\]+.*q3=\[0-9\]+.*q4=\[0-9\]+.*q5=\[0-9\]+.*q6=\[0-9\]+.*$gdb_prompt $" {
pass "$msg"
}
@@ -252,10 +231,6 @@ proc gdb_backtrace_tdp_4 { msg depth } {
-re "#\[0-9\]+\[\t \].*gdb_recursion_test.*depth=.*$gdb_prompt $" {
fail "$msg (fewer than $depth stack frames found)"
}
- -re ".*$gdb_prompt $" {
- fail "$msg"
- }
- timeout { fail "$msg (timeout)" }
}
}
Index: collection.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/collection.exp,v
retrieving revision 1.18
diff -u -p -r1.18 collection.exp
--- collection.exp 5 May 2010 18:07:04 -0000 1.18
+++ collection.exp 27 May 2010 18:16:17 -0000
@@ -292,8 +292,7 @@ proc gdb_collect_locals_test { func mylo
# Find the comment-identified line for setting this tracepoint.
set testline 0
- send_gdb "list $func, +30\n"
- gdb_expect {
+ gdb_test_multiple "list $func, +30" "collect $msg: find tracepoint line" {
-re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
set testline $expect_out(1,string)
pass "collect $msg: find tracepoint line"
@@ -400,8 +399,7 @@ proc gdb_collect_expression_test { func
# Find the comment-identified line for setting this tracepoint.
set testline 0
- send_gdb "list $func, +30\n"
- gdb_expect {
+ gdb_test_multiple "list $func, +30" "collect $msg: find tracepoint line" {
-re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
set testline $expect_out(1,string)
pass "collect $msg: find tracepoint line"
@@ -443,8 +441,7 @@ proc gdb_collect_globals_test { } {
# Find the comment-identified line for setting this tracepoint.
set testline 0
- send_gdb "list globals_test_func, +30\n"
- gdb_expect {
+ gdb_test_multiple "list globals_test_func, +30" "collect globals: find tracepoint line" {
-re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
set testline $expect_out(1,string)
pass "collect globals: find tracepoint line"
Index: deltrace.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/deltrace.exp,v
retrieving revision 1.15
diff -u -p -r1.15 deltrace.exp
--- deltrace.exp 5 May 2010 18:07:04 -0000 1.15
+++ deltrace.exp 27 May 2010 18:16:17 -0000
@@ -67,22 +67,12 @@ gdb_test "info tracepoints" \
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
"3.1a: set three tracepoints"
-send_gdb "delete tracepoints\n"
-gdb_expect 30 {
- -re "Delete all tracepoints.*y or n.*$" {
- send_gdb "y\n"
- gdb_expect 30 {
- -re "$gdb_prompt $" {
- pass "3.1b: delete all tracepoints"
- }
- timeout { fail "3.1b: delete all tracepoints (timeout)" }
- }
- }
- -re "$gdb_prompt $" { # This should only happen if there are no tracepoints
- fail "3.1b: delete all tracepoints (no tracepoints?)"
- }
- timeout { fail "3.1b: delete all tracepoints (timeout)" }
-}
+gdb_test "delete tracepoints" \
+ "" \
+ "3.1b: delete all tracepoints" \
+ "Delete all tracepoints.*y or n.*$" \
+ "y"
+
# 3.2 delete tracepoint <n>
gdb_delete_tracepoints
@@ -102,8 +92,7 @@ gdb_test "info tracepoints" \
"3.2a: set three tracepoints"
#gdb_test "delete tracepoint $trcpt1" "" ""
-send_gdb "delete tracepoint $trcpt1\n"
-gdb_expect {
+gdb_test_multiple "delete tracepoint $trcpt1" "3.2b: delete first tracepoint" {
-re "No tracepoint number.*$gdb_prompt $" {
fail "3.2b: delete first tracepoint"
}
@@ -113,9 +102,6 @@ gdb_expect {
-re "$gdb_prompt $" {
pass "3.2b: delete first tracepoint"
}
- timeout {
- fail "3.2b: delete first tracepoint (timeout)"
- }
}
gdb_test "info tracepoints" \
@@ -125,8 +111,7 @@ gdb_test "info tracepoints" \
"3.2c: verify delete first tracepoint"
#gdb_test "delete tracepoint $trcpt2" "" ""
-send_gdb "delete tracepoint $trcpt2\n"
-gdb_expect {
+gdb_test_multiple "delete tracepoint $trcpt2" "3.2d: delete second tracepoint" {
-re "No tracepoint number.*$gdb_prompt $" {
fail "3.2d: delete second tracepoint"
}
@@ -136,9 +121,6 @@ gdb_expect {
-re "$gdb_prompt $" {
pass "3.2d: delete second tracepoint"
}
- timeout {
- fail "3.2d: delete second tracepoint (timeout)"
- }
}
gdb_test "info tracepoints" \
@@ -147,8 +129,7 @@ gdb_test "info tracepoints" \
"3.2e: verify delete second tracepoint"
#gdb_test "delete tracepoint $trcpt3" "" ""
-send_gdb "delete tracepoint $trcpt3\n"
-gdb_expect {
+gdb_test_multiple "delete tracepoint $trcpt3" "3.2f: delete third tracepoint" {
-re "No tracepoint number.*$gdb_prompt $" {
fail "3.2f: delete third tracepoint"
}
@@ -158,9 +139,6 @@ gdb_expect {
-re "$gdb_prompt $" {
pass "3.2f: delete third tracepoint"
}
- timeout {
- fail "3.2f: delete third tracepoint (timeout)"
- }
}
# send_gdb "ARF! \\n\n"
@@ -186,21 +164,18 @@ gdb_test "info tracepoints" \
"3.3a: set three tracepoints"
#gdb_test "delete tracepoint $trcpt1 $trcpt2 $trcpt3" "" ""
-send_gdb "delete tracepoint $trcpt1 $trcpt2 $trcpt3\n"
-gdb_expect {
- -re "No tracepoint number.*$gdb_prompt $" {
- fail "3.3b: delete three tracepoints"
- }
- -re ".*\[Ee\]rror.*$gdb_prompt $" {
- fail "3.3b: delete three tracepoints"
- }
- -re "$gdb_prompt $" {
- pass "3.3b: delete three tracepoints"
- }
- timeout {
- fail "3.3b: delete three tracepoint (timeout)"
+gdb_test_multiple "delete tracepoint $trcpt1 $trcpt2 $trcpt3" \
+ "3.3b: delete three tracepoints" {
+ -re "No tracepoint number.*$gdb_prompt $" {
+ fail "3.3b: delete three tracepoints"
+ }
+ -re ".*\[Ee\]rror.*$gdb_prompt $" {
+ fail "3.3b: delete three tracepoints"
+ }
+ -re "$gdb_prompt $" {
+ pass "3.3b: delete three tracepoints"
+ }
}
-}
gdb_test "info tracepoints" \
"No tracepoints." \
Index: infotrace.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/infotrace.exp,v
retrieving revision 1.16
diff -u -p -r1.16 infotrace.exp
--- infotrace.exp 5 May 2010 18:07:04 -0000 1.16
+++ infotrace.exp 27 May 2010 18:16:17 -0000
@@ -76,15 +76,15 @@ gdb_test "info tracepoint [expr $c_test_
"2.3: info tracepoint (invalid tracepoint number)"
# 2.4 info tracepoints (list of numbers)
-send_gdb "info tracepoints $c_test_num $asm_test_num \n"
-gdb_expect {
- -re "Num Enb .*$gdb_prompt $" {
- fail "2.4: info trace rejects multiple tracepoint numbers"
+gdb_test_multiple "info tracepoints $c_test_num $asm_test_num " \
+ "2.4: info trace rejects multiple tracepoint numbers" {
+ -re "Num Enb .*$gdb_prompt $" {
+ fail "2.4: info trace rejects multiple tracepoint numbers"
+ }
+ -re ".*$gdb_prompt $" {
+ pass "2.4: info trace rejects multiple tracepoint numbers"
+ }
}
- -re ".*$gdb_prompt $" {
- pass "2.4: info trace rejects multiple tracepoint numbers"
- }
-}
# 2.5 help info trace
gdb_test "help info tracepoints" \
Index: limits.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/limits.exp,v
retrieving revision 1.13
diff -u -p -r1.13 limits.exp
--- limits.exp 5 May 2010 18:07:04 -0000 1.13
+++ limits.exp 27 May 2010 18:16:17 -0000
@@ -69,15 +69,8 @@ proc gdb_tracepoint_limit_test { } {
"tracepoint limit test: set limit to four"
# Now sending three tracepoints should succeed.
- send_gdb "tstart\n"
- gdb_expect {
- -re "$cr$gdb_prompt" {
- pass "tracepoint limit test: send fewer than limit"
- }
- default {
- fail "tracepoint limit test: send fewer than limit"
- }
- }
+ gdb_test_no_output "tstart" \
+ "tracepoint limit test: send fewer than limit"
# Set secret artificial tracepoint limit to three
gdb_test "maint packet QTLimit:tp:3" \
@@ -85,15 +78,8 @@ proc gdb_tracepoint_limit_test { } {
"tracepoint limit test: set limit to three"
# Now sending three tracepoints should still succeed.
- send_gdb "tstart\n"
- gdb_expect {
- -re "$cr$gdb_prompt" {
- pass "tracepoint limit test: send equal to limit"
- }
- default {
- fail "tracepoint limit test: send equal to limit"
- }
- }
+ gdb_test_no_output "tstart" \
+ "tracepoint limit test: send equal to limit"
# Set secret artificial tracepoint limit to two
gdb_test "maint packet QTLimit:tp:2" \
@@ -150,15 +136,8 @@ proc gdb_memrange_limit_test { } {
"memrange limit test: set limit to four"
# Now sending three memranges should still succeed.
- send_gdb "tstart\n"
- gdb_expect {
- -re "$cr$gdb_prompt" {
- pass "memrange limit test: send fewer than limit"
- }
- default {
- fail "memrange limit test: send fewer than limit"
- }
- }
+ gdb_test_no_output "tstart" \
+ "memrange limit test: send fewer than limit"
# Set secret artificial memrange limit to three
gdb_test "maint packet QTLimit:memrange:3" \
@@ -166,15 +145,8 @@ proc gdb_memrange_limit_test { } {
"memrange limit test: set limit to three"
# Now sending three memranges should still succeed.
- send_gdb "tstart\n"
- gdb_expect {
- -re "$cr$gdb_prompt" {
- pass "memrange limit test: send equal to limit"
- }
- default {
- fail "memrange limit test: send equal to limit"
- }
- }
+ gdb_test_no_output "tstart" \
+ "memrange limit test: send equal to limit"
# Set secret artificial memrange limit to two
gdb_test "maint packet QTLimit:memrange:2" \
@@ -232,15 +204,8 @@ proc gdb_bytecode_limit_test { } {
"bytecode limit test: set limit to large"
# Now sending three bytecodes should still succeed.
- send_gdb "tstart\n"
- gdb_expect {
- -re "$cr$gdb_prompt" {
- pass "bytecode limit test: send fewer than limit"
- }
- default {
- fail "bytecode limit test: send fewer than limit"
- }
- }
+ gdb_test_no_output "tstart" \
+ "bytecode limit test: send fewer than limit"
# Set secret artificial bytecode limit to a small number
gdb_test "maint packet QTLimit:bytecode:40" \
Index: report.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/report.exp,v
retrieving revision 1.15
diff -u -p -r1.15 report.exp
--- report.exp 5 May 2010 18:07:04 -0000 1.15
+++ report.exp 27 May 2010 18:16:17 -0000
@@ -76,8 +76,7 @@ if { $gdb_recursion_test_baseline == -1
return;
}
-send_gdb "list $gdb_recursion_test_baseline, +12\n"
-gdb_expect {
+gdb_test_multiple "list $gdb_recursion_test_baseline, +12"
-re "\[\r\n\](\[0-9\]+)\[^\r\n\]+gdbtestline 1 " {
set testline1 $expect_out(1,string)
exp_continue
@@ -273,20 +272,13 @@ gdb_test "printf \"x %d x\\n\", \$tracep
gdb_test "printf \"x %d x\\n\", \$trace_line" "x $testline1 x" \
"11.3: test \$trace_line"
-send_gdb "print \$trace_file\n"
-gdb_expect {
+gdb_test_multiple "print \$trace_file" "11.4: test \$trace_file" {
-re "\\$\[0-9\]+ = \"$srcfile\"\[\r\n\]+$gdb_prompt $" {
pass "11.4: test \$trace_file"
}
-re "\\$\[0-9\]+ = \"$srcdir/$subdir/$srcfile\"\[\r\n\]+$gdb_prompt $" {
pass "11.4: test \$trace_file"
}
- -re "$gdb_prompt $" {
- fail "11.4: test \$trace_file"
- }
- timeout {
- fail "11.4: test \$trace_file (timeout)"
- }
}
#gdb_test "print \$trace_file" "\"$srcdir/$subdir/$srcfile\"" \
@@ -296,8 +288,7 @@ gdb_expect {
# 12.x test report generation using arbitrary GDB commands, loops etc.
#
-send_gdb "while \$trace_frame != -1\n output \$trace_file\n printf \", line \%d \(tracepoint #\%d\)\\n\", \$trace_line, \$tracepoint\n tfind\n end\n"
-gdb_expect {
+gdb_test_multiple "while \$trace_frame != -1\n output \$trace_file\n printf \", line \%d \(tracepoint #\%d\)\\n\", \$trace_line, \$tracepoint\n tfind\n end" "12.1: trace report #1" {
-re " line $testline1 .tracepoint .$tdp1" {
set linecount1 [expr $linecount1 + 1]
exp_continue
@@ -329,9 +320,6 @@ gdb_expect {
pass "12.1: trace report #1"
}
}
- timeout {
- fail "12.1: trace report #1 (timeout)"
- }
}
gdb_tfind_test "12.2: tfind end, selects no frame" "end" "-1"
@@ -340,8 +328,7 @@ gdb_tfind_test "12.2: find first TDP #2
set linecount2 0
-send_gdb "while \$trace_frame != -1\n printf \"tracepoint #\%d, FP 0x\%08x, SP 0x\%08x, PC 0x%08x\\n\", \$tracepoint, \$fp, \$sp, \$pc\n tfind tracepoint\n end\n"
-gdb_expect {
+gdb_test_multiple "while \$trace_frame != -1\n printf \"tracepoint #\%d, FP 0x\%08x, SP 0x\%08x, PC 0x%08x\\n\", \$tracepoint, \$fp, \$sp, \$pc\n tfind tracepoint\n end" "12.2: trace report #2" {
-re "tracepoint #$tdp2, FP $hex, SP $hex, PC $hex" {
set linecount2 [expr $linecount2 + 1]
exp_continue
@@ -353,9 +340,6 @@ gdb_expect {
pass "12.2: trace report #2"
}
}
- timeout {
- fail "12.2: trace report #2 (timeout)"
- }
}
gdb_tfind_test "12.3: tfind end, selects no frame" "end" "-1"
@@ -364,8 +348,7 @@ gdb_tfind_test "12.3: find first TDP #3
set linecount3 0
-send_gdb "while \$trace_frame != -1\n printf \"TDP #\%d, frame \%d: depth = \%d, q1 = \%d\\n\", \$tracepoint, \$trace_frame, depth, q1\n tfind tracepoint\n end\n"
-gdb_expect {
+gdb_test_multiple "while \$trace_frame != -1\n printf \"TDP #\%d, frame \%d: depth = \%d, q1 = \%d\\n\", \$tracepoint, \$trace_frame, depth, q1\n tfind tracepoint\n end" "12.3: trace report #3" {
-re "TDP #$tdp3, frame $decimal: depth = $decimal, q1 = $decimal" {
set linecount3 [expr $linecount3 + 1]
exp_continue
@@ -377,9 +360,6 @@ gdb_expect {
pass "12.3: trace report #3"
}
}
- timeout {
- fail "12.3: trace report #3 (timeout)"
- }
}
gdb_tfind_test "12.4: tfind end, selects no frame" "end" "-1"
@@ -388,8 +368,7 @@ gdb_tfind_test "12.4: find first TDP #6
set linecount6 0
-send_gdb "while \$trace_frame != -1\n printf \"TDP #\%d, frame %d: char_test = \%d, long_test = \%d\\n\", \$tracepoint, \$trace_frame, gdb_char_test, gdb_long_test\n tfind tracepoint\n end\n"
-gdb_expect {
+gdb_test_multiple "while \$trace_frame != -1\n printf \"TDP #\%d, frame %d: char_test = \%d, long_test = \%d\\n\", \$tracepoint, \$trace_frame, gdb_char_test, gdb_long_test\n tfind tracepoint\n end" "12.4: trace report #4" {
-re "TDP #$tdp6, frame $decimal: char_test = $arg1, long_test = $arg3" {
set linecount6 [expr $linecount6 + 1]
exp_continue
@@ -401,9 +380,6 @@ gdb_expect {
pass "12.4: trace report #4"
}
}
- timeout {
- fail "12.4: trace report #4 (timeout)"
- }
}
# Finished!
Index: save-trace.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/save-trace.exp,v
retrieving revision 1.18
diff -u -p -r1.18 save-trace.exp
--- save-trace.exp 5 May 2010 18:07:04 -0000 1.18
+++ save-trace.exp 27 May 2010 18:16:17 -0000
@@ -94,8 +94,7 @@ proc gdb_verify_tracepoints { testname }
set nl "\[\r\n\]+"
set ourstate 1;
set result "pass";
- send_gdb "info tracepoints\n";
- gdb_expect 10 {
+ gdb_test_multiple "info tracepoints" "$testname" {
-re "\[0-9\]+\[\t \]+tracepoint\[\t \]+keep y\[\t \]+0x\[0-9a-fA-F\]+ in gdb_recursion_test\[^\r\n\]+\r\n\[ \t]+trace only if \[0-9\] - 1 == \[0-9\] / 2" {
# if { $expect_out(1,string) != $ourstate } {
# set result "fail";
Index: tfind.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/tfind.exp,v
retrieving revision 1.19
diff -u -p -r1.19 tfind.exp
--- tfind.exp 5 May 2010 18:07:04 -0000 1.19
+++ tfind.exp 27 May 2010 18:16:17 -0000
@@ -83,8 +83,7 @@ if { $tdp1 <= 0 || $tdp2 <= 0 || $tdp3 <
}
# 6.1 test tstart command
-send_gdb "tstart\n"
-gdb_expect {
+gdb_test_multiple "tstart" "6.1: tstart" {
-re "Trace can only be run on remote targets.*$gdb_prompt $" {
fail "6.1: tstart (not connected to remote?)"
return;
@@ -118,8 +117,7 @@ gdb_test "continue" \
"run trace experiment"
# 7.1 test tstop command
-send_gdb "tstop\n"
-gdb_expect {
+gdb_test_multiple "tstop" "7.1: tstop" {
-re "Trace can only be run on remote targets.*$gdb_prompt $" {
fail "7.1: tstop (not connected to remote?)"
return;
@@ -329,13 +327,10 @@ gdb_tfind_test "8.17: tfind line <no arg
# 8.36 tfind and disassembly
gdb_tfind_test "8.36: tfind start" "start" "0"
set timeout 60
-send_gdb "disassemble gdb_c_test\n"
# look for disassembly of function label
-gdb_expect {
- -re "<(\.\[0-9\]+|)>:.*End of assembler dump.*$gdb_prompt $" { pass "8.36: trace disassembly" }
- -re ".*$gdb_prompt $" { fail "8.36: trace disassembly" }
- timeout { fail "8.36: trace disassembly (timeout)" }
-}
+gdb_test "disassemble gdb_c_test" \
+ "<(\.\[0-9\]+|)>:.*End of assembler dump.*" \
+ "8.36: trace disassembly"
gdb_test "tfind line 0" \
"out of range.*|failed to find.*" \
Index: tracecmd.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/tracecmd.exp,v
retrieving revision 1.17
diff -u -p -r1.17 tracecmd.exp
--- tracecmd.exp 5 May 2010 18:07:04 -0000 1.17
+++ tracecmd.exp 27 May 2010 18:16:17 -0000
@@ -103,12 +103,10 @@ gdb_test "info trace" "No tracepoints.*"
# 1.6 trace at a specific address
# Collect the address of "gdb_asm_test", and use that.
-send_gdb "print gdb_asm_test\n"
-gdb_expect {
+gdb_test_multiple "print gdb_asm_test" "" {
-re "\[$\]\[0-9\].*0x(\[0-9a-fA-F\]+).*$gdb_prompt $" {
set asm_test_addr $expect_out(1,string)
}
- timeout { }
}
gdb_delete_tracepoints
@@ -120,12 +118,10 @@ gdb_test "info trace" "$asm_test_addr.*g
# 1.7 trace at function's exact address
# Collect the address of the function for comparison
-send_gdb "print gdb_recursion_test\n"
-gdb_expect {
+gdb_test_multiple "print gdb_recursion_test" "" {
-re "\[$\]\[0-9\].*0x(\[0-9a-fA-F\]+).*$gdb_prompt $" {
set c_test_addr $expect_out(1,string)
}
- timeout { }
}
gdb_delete_tracepoints
@@ -166,12 +162,12 @@ gdb_test "help trace" "Set a tracepoint
gdb_delete_tracepoints
-send_gdb "ftrace gdb_recursion_test\n"
# Acceptance vs rejection of a location are target-specific, so allow both.
-gdb_expect {
- -re "Fast tracepoint $decimal at $hex: file.*$srcfile, line $testline1.*$gdb_prompt $"
- { pass "Set a fast tracepoint" }
- -re ".*May not have a fast tracepoint at $hex.*$gdb_prompt $"
- { pass "Declined to set a fast tracepoint" }
- timeout { fail "Timeout while setting fast tracepoint" }
+gdb_test_multiple "ftrace gdb_recursion_test" "Set a fast tracepoint" {
+ -re "Fast tracepoint $decimal at $hex: file.*$srcfile, line $testline1.*$gdb_prompt $" {
+ pass "Set a fast tracepoint"
+ }
+ -re ".*May not have a fast tracepoint at $hex.*$gdb_prompt $" {
+ pass "Declined to set a fast tracepoint"
+ }
}
Index: tsv.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/tsv.exp,v
retrieving revision 1.3
diff -u -p -r1.3 tsv.exp
--- tsv.exp 5 May 2010 18:07:04 -0000 1.3
+++ tsv.exp 27 May 2010 18:16:17 -0000
@@ -82,21 +82,11 @@ gdb_test "info tvariables" \
\\\$tvar3\[\t \]+1234567000000\[\t \]+.*<undefined>.*" \
"List tvariables after deletion"
-send_gdb "delete tvariable\n"
-gdb_expect 30 {
- -re "Delete all trace state variables.*y or n.*$" {
- send_gdb "y\n"
- gdb_expect 30 {
- -re "$gdb_prompt $" {
- pass "Delete all trace state variables"
- }
- timeout { fail "Delete all trace state variables (timeout)" }
- }
- }
- -re "$gdb_prompt $" { # This happens if there were no variables
- }
- timeout { perror "Delete all trace state variables (timeout)" ; return }
-}
+gdb_test "delete tvariable" \
+ "" \
+ "Delete all trace state variables" \
+ "Delete all trace state variables.*y or n.*$" \
+ "y"
gdb_test "info tvariables" \
"No trace state variables.*" \
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] gdb.trace/*.exp send_gdb vs. gdb_test
2010-05-27 18:22 [RFA] gdb.trace/*.exp send_gdb vs. gdb_test Michael Snyder
@ 2010-05-27 18:44 ` Pedro Alves
2010-05-27 19:14 ` Michael Snyder
0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2010-05-27 18:44 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches, Stan Shebs
On Thursday 27 May 2010 19:18:37, Michael Snyder wrote:
> This patch should get extra-thorough review and preferably be tested by
> the tracepoint maintainers, since I wasn't able to test all of it.
Did you test it against gdbserver x86 or x86_64? That should cover it:
<http://sourceware.org/gdb/wiki/TestingGDB#Testing_gdbserver_in_a_native_configuration>
--
Pedro Alves
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] gdb.trace/*.exp send_gdb vs. gdb_test
2010-05-27 18:44 ` Pedro Alves
@ 2010-05-27 19:14 ` Michael Snyder
2010-05-27 23:15 ` Pedro Alves
0 siblings, 1 reply; 10+ messages in thread
From: Michael Snyder @ 2010-05-27 19:14 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, Stan Shebs
Pedro Alves wrote:
> On Thursday 27 May 2010 19:18:37, Michael Snyder wrote:
>> This patch should get extra-thorough review and preferably be tested by
>> the tracepoint maintainers, since I wasn't able to test all of it.
>
> Did you test it against gdbserver x86 or x86_64? That should cover it:
>
> <http://sourceware.org/gdb/wiki/TestingGDB#Testing_gdbserver_in_a_native_configuration>
OK thanks. They all work except for limits.exp, which does not run
because it tests "tstatus" before it executes "target remote".
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] gdb.trace/*.exp send_gdb vs. gdb_test
2010-05-27 19:14 ` Michael Snyder
@ 2010-05-27 23:15 ` Pedro Alves
2010-05-27 23:25 ` Pedro Alves
2010-06-02 19:42 ` Michael Snyder
0 siblings, 2 replies; 10+ messages in thread
From: Pedro Alves @ 2010-05-27 23:15 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches, Stan Shebs
On Thursday 27 May 2010 20:08:40, Michael Snyder wrote:
> Pedro Alves wrote:
> > On Thursday 27 May 2010 19:18:37, Michael Snyder wrote:
> >> This patch should get extra-thorough review and preferably be tested by
> >> the tracepoint maintainers, since I wasn't able to test all of it.
> >
> > Did you test it against gdbserver x86 or x86_64? That should cover it:
> >
> > <http://sourceware.org/gdb/wiki/TestingGDB#Testing_gdbserver_in_a_native_configuration>
>
> OK thanks. They all work except for limits.exp, which does not run
> because it tests "tstatus" before it executes "target remote".
Thanks for testing. Indeed, I had never noticed that. I can't say
I'm fond of the:
"We generously give ourselves one "pass" if we
successfully detect that this test cannot be run on this target!"
pattern in this tests. :-) I wonder who shall I complain
about that to. ;-)
Let me try to fix that before you commit. Should be simple.
Other tests had the same issue, and I thought I had fixed them
all, but obviously this one slipped.
I took a look at your patch.
> -send_gdb "list $baseline, +12\n"
> -gdb_expect {
> +gdb_test_multiple "list $baseline, +12" "all tests in this module will fail" {
> -re "\[\r\n\](\[0-9\]+).*gdbtestline 1 " {
> set testline1 $expect_out(1,string)
> exp_continue
> @@ -108,7 +107,7 @@ all tests in this module will fail."
> untested backtrace.exp
> return -1
> all tests in this module will fail."
> - }
> + }
> }
>
Can you do the return outside of gdb_test_multiple please?
I saw a few other instances in tfind.exp. Otherwise, looked fine.
--
Pedro Alves
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] gdb.trace/*.exp send_gdb vs. gdb_test
2010-05-27 23:15 ` Pedro Alves
@ 2010-05-27 23:25 ` Pedro Alves
2010-05-28 0:18 ` Michael Snyder
2010-06-02 19:42 ` Michael Snyder
1 sibling, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2010-05-27 23:25 UTC (permalink / raw)
To: gdb-patches; +Cc: Michael Snyder, Stan Shebs
On Thursday 27 May 2010 23:50:40, Pedro Alves wrote:
> Let me try to fix that before you commit. Should be simple.
> Other tests had the same issue, and I thought I had fixed them
> all, but obviously this one slipped.
Oh bummer. The patch pasted at the end fixes that, but...
gdb.sum:
Running target native-gdbserver
Running ../../../src/gdb/testsuite/gdb.trace/limits.exp ...
FAIL: gdb.trace/limits.exp: maint packet QTLimit:tp:ffffffff
PASS: gdb.trace/limits.exp: This test cannot be run on this target
=== gdb Summary ===
# of expected passes 1
# of unexpected failures 1
gdb.log:
(gdb) maint packet QTLimit:tp:ffffffff
sending: "QTLimit:tp:ffffffff"
received: ""
(gdb) FAIL: gdb.trace/limits.exp: maint packet QTLimit:tp:ffffffff
... the test is using an undocumented packet to set
artificial limits on the remote tracing engine. GDBserver doesn't
implement that packet. I had never heard of this packet, and I'm
not sure it makes much sense to have this test nowadays. Can we
just get rid of the whole test file?
Otherwise, the "doesn't support this packet" detection looks bogus:
if [gdb_test "maint packet QTLimit:tp:ffffffff" \
"received: .OK." ""] then {
pass "This test cannot be run on this target"
return 1;
}
The test is skipped if the target returns something that
contains "OK" ??
---
gdb/testsuite/gdb.trace/limits.exp | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
Index: src/gdb/testsuite/gdb.trace/limits.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/limits.exp 2010-05-28 00:08:29.000000000 +0100
+++ src/gdb/testsuite/gdb.trace/limits.exp 2010-05-28 00:08:18.000000000 +0100
@@ -22,6 +22,7 @@ if $tracelevel then {
set testfile "limits"
set srcfile ${testfile}.c
+set executable $testfile
set binfile $objdir/$subdir/$testfile
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
@@ -294,11 +295,9 @@ proc gdb_trace_limits_tests { } {
# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
-
+clean_restart $executable
+runto_main
+
if [target_info exists gdb_stub] {
gdb_step_for_stub;
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] gdb.trace/*.exp send_gdb vs. gdb_test
2010-05-27 23:25 ` Pedro Alves
@ 2010-05-28 0:18 ` Michael Snyder
2010-05-29 0:41 ` Pedro Alves
0 siblings, 1 reply; 10+ messages in thread
From: Michael Snyder @ 2010-05-28 0:18 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, Stan Shebs
Pedro Alves wrote:
> ... the test is using an undocumented packet to set
> artificial limits on the remote tracing engine. GDBserver doesn't
> implement that packet. I had never heard of this packet, and I'm
> not sure it makes much sense to have this test nowadays. Can we
> just get rid of the whole test file?
OK with me, but probably not my decision...
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] gdb.trace/*.exp send_gdb vs. gdb_test
2010-05-28 0:18 ` Michael Snyder
@ 2010-05-29 0:41 ` Pedro Alves
0 siblings, 0 replies; 10+ messages in thread
From: Pedro Alves @ 2010-05-29 0:41 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches, Stan Shebs
On Friday 28 May 2010 00:24:59, Michael Snyder wrote:
> Pedro Alves wrote:
>
> > ... the test is using an undocumented packet to set
> > artificial limits on the remote tracing engine. GDBserver doesn't
> > implement that packet. I had never heard of this packet, and I'm
> > not sure it makes much sense to have this test nowadays. Can we
> > just get rid of the whole test file?
>
>
> OK with me, but probably not my decision...
Okay, since you wrote it, and won't miss it, and nobody spoke in its
defense, I went ahead and removed it.
--
Pedro Alves
2010-05-29 Pedro Alves <pedro@codesourcery.com>
* limits.c, limits.exp: Delete files.
* Makefile.in (clean mostlyclean): Adjust.
* tracecmd.exp: Adjust.
---
gdb/testsuite/gdb.trace/Makefile.in | 2
gdb/testsuite/gdb.trace/limits.c | 51 -----
gdb/testsuite/gdb.trace/limits.exp | 306 -----------------------------------
gdb/testsuite/gdb.trace/tracecmd.exp | 3
4 files changed, 2 insertions(+), 360 deletions(-)
Index: src/gdb/testsuite/gdb.trace/Makefile.in
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/Makefile.in 2010-05-28 22:57:03.000000000 +0100
+++ src/gdb/testsuite/gdb.trace/Makefile.in 2010-05-28 22:58:51.000000000 +0100
@@ -7,7 +7,7 @@ all info install-info dvi install uninst
@echo "Nothing to be done for $@..."
clean mostlyclean:
- -rm -f actions circ collection limits
+ -rm -f actions circ collection
-rm -f *.o *.diff *~ *.bad core sh3 hppa mn10300
distclean maintainer-clean realclean: clean
Index: src/gdb/testsuite/gdb.trace/limits.c
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/limits.c 2010-05-28 22:56:58.000000000 +0100
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,51 +0,0 @@
-/*
- * Test program for tracing internal limits (number of tracepoints etc.)
- */
-
-int n = 6;
-
-int arr[64];
-
-static void foo(int x)
-{
-}
-
-static void bar(int y)
-{
-}
-
-static void baz(int z)
-{
-}
-
-static void begin () /* called before anything else */
-{
-}
-
-static void end () /* called after everything else */
-{
-}
-
-int
-main (argc, argv, envp)
- int argc;
- char *argv[], **envp;
-{
- int i;
-
-#ifdef usestubs
- set_debug_traps ();
- breakpoint ();
-#endif
-
- begin ();
- for (i = 0; i < sizeof(arr) / sizeof(arr[0]); i++)
- arr[i] = i + 1;
-
- foo (1);
- bar (2);
- baz (3);
- end ();
- return 0;
-}
-
Index: src/gdb/testsuite/gdb.trace/limits.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/limits.exp 2010-05-28 22:56:27.000000000 +0100
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,306 +0,0 @@
-# Copyright 1998, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-load_lib "trace-support.exp"
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-
-set testfile "limits"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/$testfile
-
-if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
- executable {debug nowarnings}] != "" } {
- untested limits.exp
- return -1
-}
-
-# Tests:
-# 1) Meet and exceed artificial limit on number of tracepoints
-# 2) Meet and exceed artificial limit on number of memranges
-# 3) Meet and exceed artificial limit on bytes of bytecode data
-# [NOTE: number four is moved out into its own separate test module.]
-# 4) Meet and exceed artificial limit on bytes of trace buffer storage
-# (circular and non-circular modes). However note that a more
-# thorough test of the circular mode can be made separately.
-
-set cr "\[\r\n\]+"
-
-proc gdb_tracepoint_limit_test { } {
- global gdb_prompt
- global cr
-
- # Make sure we're in a sane starting state.
- gdb_test "tstop" "" ""
- gdb_test "tfind none" "" ""
- gdb_delete_tracepoints
-
- # Set three tracepoints
- gdb_test "trace foo" \
- "Tracepoint \[0-9\]+ at .*" \
- "tracepoint limit test: set first tracepoint"
-
- gdb_test "trace bar" \
- "Tracepoint \[0-9\]+ at .*" \
- "tracepoint limit test: set second tracepoint"
-
- gdb_test "trace baz" \
- "Tracepoint \[0-9\]+ at .*" \
- "tracepoint limit test: set third tracepoint"
-
- # Set secret artificial tracepoint limit to four
- gdb_test "maint packet QTLimit:tp:4" \
- "received: .OK." \
- "tracepoint limit test: set limit to four"
-
- # Now sending three tracepoints should succeed.
- send_gdb "tstart\n"
- gdb_expect {
- -re "$cr$gdb_prompt" {
- pass "tracepoint limit test: send fewer than limit"
- }
- default {
- fail "tracepoint limit test: send fewer than limit"
- }
- }
-
- # Set secret artificial tracepoint limit to three
- gdb_test "maint packet QTLimit:tp:3" \
- "received: .OK." \
- "tracepoint limit test: set limit to three"
-
- # Now sending three tracepoints should still succeed.
- send_gdb "tstart\n"
- gdb_expect {
- -re "$cr$gdb_prompt" {
- pass "tracepoint limit test: send equal to limit"
- }
- default {
- fail "tracepoint limit test: send equal to limit"
- }
- }
-
- # Set secret artificial tracepoint limit to two
- gdb_test "maint packet QTLimit:tp:2" \
- "received: .OK." \
- "tracepoint limit test: set limit to two"
-
- # Now sending three tracepoints should fail.
- gdb_test "tstart" \
- ".*\[Ee\]rror.*" \
- "tracepoint limit test: send more than limit"
-
- # Clean up:
- gdb_test "tstop" "" ""
- gdb_test "maint packet QTLimit:tp:FFFFFFFF" "" ""
-}
-
-proc gdb_memrange_limit_test { } {
- global gdb_prompt
- global cr
-
- # Make sure we're in a sane starting state.
- gdb_test "tstop" "" ""
- gdb_test "tfind none" "" ""
- gdb_delete_tracepoints
-
- # Set three tracepoints, and make 'em collect memranges
- gdb_test "trace foo" \
- "Tracepoint \[0-9\]+ at .*" \
- "memrange limit test: set first tracepoint"
-
- gdb_trace_setactions "memrange limit test: set first actions" \
- "" \
- "collect \$arg" "^$"
-
- gdb_test "trace bar" \
- "Tracepoint \[0-9\]+ at .*" \
- "memrange limit test: set second tracepoint"
-
- gdb_trace_setactions "memrange limit test: set second actions" \
- "" \
- "collect \$arg" "^$"
-
- gdb_test "trace baz" \
- "Tracepoint \[0-9\]+ at .*" \
- "memrange limit test: set third tracepoint"
-
- gdb_trace_setactions "memrange limit test: set third actions" \
- "" \
- "collect \$arg" "^$"
-
- # Set secret artificial memrange limit to four
- gdb_test "maint packet QTLimit:memrange:4" \
- "received: .OK." \
- "memrange limit test: set limit to four"
-
- # Now sending three memranges should still succeed.
- send_gdb "tstart\n"
- gdb_expect {
- -re "$cr$gdb_prompt" {
- pass "memrange limit test: send fewer than limit"
- }
- default {
- fail "memrange limit test: send fewer than limit"
- }
- }
-
- # Set secret artificial memrange limit to three
- gdb_test "maint packet QTLimit:memrange:3" \
- "received: .OK." \
- "memrange limit test: set limit to three"
-
- # Now sending three memranges should still succeed.
- send_gdb "tstart\n"
- gdb_expect {
- -re "$cr$gdb_prompt" {
- pass "memrange limit test: send equal to limit"
- }
- default {
- fail "memrange limit test: send equal to limit"
- }
- }
-
- # Set secret artificial memrange limit to two
- gdb_test "maint packet QTLimit:memrange:2" \
- "received: .OK." \
- "memrange limit test: set limit to two"
-
- # Now sending three memranges should fail.
- gdb_test "tstart" \
- ".*\[Ee\]rror.*" \
- "memrange limit test: send more than limit"
-
- # Clean up:
- gdb_test "tstop" "" ""
- gdb_test "maint packet QTLimit:memrange:FFFFFFFF" "" ""
-}
-
-
-proc gdb_bytecode_limit_test { } {
- global gdb_prompt
- global cr
-
- # Make sure we're in a sane starting state.
- gdb_test "tstop" "" ""
- gdb_test "tfind none" "" ""
- gdb_delete_tracepoints
-
- # Set three tracepoints
- gdb_test "trace foo" \
- "Tracepoint \[0-9\]+ at .*" \
- "bytecode limit test: set first tracepoint"
-
- gdb_trace_setactions "bytecode limit test: set first actions" \
- "" \
- "collect x + n" "^$"
-
- gdb_test "trace bar" \
- "Tracepoint \[0-9\]+ at .*" \
- "bytecode limit test: set second tracepoint"
-
- gdb_trace_setactions "bytecode limit test: set second actions" \
- "" \
- "collect y + n" "^$"
-
- gdb_test "trace baz" \
- "Tracepoint \[0-9\]+ at .*" \
- "bytecode limit test: set third tracepoint"
-
- gdb_trace_setactions "bytecode limit test: set third actions" \
- "" \
- "collect z + n" "^$"
-
- # Set secret artificial bytecode limit to a large number
- gdb_test "maint packet QTLimit:bytecode:400" \
- "received: .OK." \
- "bytecode limit test: set limit to large"
-
- # Now sending three bytecodes should still succeed.
- send_gdb "tstart\n"
- gdb_expect {
- -re "$cr$gdb_prompt" {
- pass "bytecode limit test: send fewer than limit"
- }
- default {
- fail "bytecode limit test: send fewer than limit"
- }
- }
-
- # Set secret artificial bytecode limit to a small number
- gdb_test "maint packet QTLimit:bytecode:40" \
- "received: .OK." \
- "bytecode limit test: set limit to small"
-
- # Now sending three bytecodes should fail.
- gdb_test "tstart" \
- ".*\[Ee\]rror.*" \
- "bytecode limit test: send more than limit"
-
-
- # Clean up:
- gdb_test "tstop" "" ""
- gdb_test "maint packet QTLimit:bytecode:FFFFFFFF" "" ""
-}
-
-proc gdb_trace_limits_tests { } {
- global gdb_prompt
-
- # We generously give ourselves one "pass" if we successfully
- # detect that this test cannot be run on this target!
-
- if { ![gdb_target_supports_trace] } then {
- pass "Current target does not support trace"
- return 1;
- }
-
- if [gdb_test "maint packet QTLimit:tp:ffffffff" \
- "received: .OK." ""] then {
- pass "This test cannot be run on this target"
- return 1;
- }
-
- if [gdb_test "maint packet QTLimit:memrange:ffffffff" \
- "received: .OK." ""] then {
- pass "This test cannot be run on this target"
- return 1;
- }
-
- if [gdb_test "maint packet QTLimit:bytecode:ffffffff" \
- "received: .OK." ""] then {
- pass "This test cannot be run on this target"
- return;
- }
-
- gdb_tracepoint_limit_test
- gdb_memrange_limit_test
- gdb_bytecode_limit_test
-}
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
-
-if [target_info exists gdb_stub] {
- gdb_step_for_stub;
-}
-# Body of test encased in a proc so we can return prematurely.
-gdb_trace_limits_tests
Index: src/gdb/testsuite/gdb.trace/tracecmd.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/tracecmd.exp 2010-05-28 22:57:07.000000000 +0100
+++ src/gdb/testsuite/gdb.trace/tracecmd.exp 2010-05-28 22:59:35.000000000 +0100
@@ -142,8 +142,7 @@ gdb_test "info trace" "$c_test_addr.*in
gdb_test "trace" "No default breakpoint address now." \
"1.9: trace <no arguments>"
-# 1.10 set large number of tracepoints
-# deferred to limits test module
+# 1.10 there's no 1.10.
# 1.11 tracepoint conditions
gdb_delete_tracepoints
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] gdb.trace/*.exp send_gdb vs. gdb_test
2010-05-27 23:15 ` Pedro Alves
2010-05-27 23:25 ` Pedro Alves
@ 2010-06-02 19:42 ` Michael Snyder
2010-06-02 21:58 ` Pedro Alves
1 sibling, 1 reply; 10+ messages in thread
From: Michael Snyder @ 2010-06-02 19:42 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, Stan Shebs
Pedro Alves wrote:
> On Thursday 27 May 2010 20:08:40, Michael Snyder wrote:
>> Pedro Alves wrote:
>>> On Thursday 27 May 2010 19:18:37, Michael Snyder wrote:
>>>> This patch should get extra-thorough review and preferably be tested by
>>>> the tracepoint maintainers, since I wasn't able to test all of it.
>>> Did you test it against gdbserver x86 or x86_64? That should cover it:
>>>
>>> <http://sourceware.org/gdb/wiki/TestingGDB#Testing_gdbserver_in_a_native_configuration>
>> OK thanks. They all work except for limits.exp, which does not run
>> because it tests "tstatus" before it executes "target remote".
>
> Thanks for testing. Indeed, I had never noticed that. I can't say
> I'm fond of the:
>
> "We generously give ourselves one "pass" if we
> successfully detect that this test cannot be run on this target!"
>
> pattern in this tests. :-) I wonder who shall I complain
> about that to. ;-)
>
> Let me try to fix that before you commit. Should be simple.
> Other tests had the same issue, and I thought I had fixed them
> all, but obviously this one slipped.
>
> I took a look at your patch.
>
>> -send_gdb "list $baseline, +12\n"
>> -gdb_expect {
>> +gdb_test_multiple "list $baseline, +12" "all tests in this module will fail" {
>> -re "\[\r\n\](\[0-9\]+).*gdbtestline 1 " {
>> set testline1 $expect_out(1,string)
>> exp_continue
>> @@ -108,7 +107,7 @@ all tests in this module will fail."
>> untested backtrace.exp
>> return -1
>> all tests in this module will fail."
>> - }
>> + }
>> }
>>
>
> Can you do the return outside of gdb_test_multiple please?
> I saw a few other instances in tfind.exp. Otherwise, looked fine.
Done and committed. By the way, would you take a look at the
diff just above? What is "all tests in this module will fail"
doing there? The same thing appears in both backtrace.exp and
report.exp.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] gdb.trace/*.exp send_gdb vs. gdb_test
2010-06-02 19:42 ` Michael Snyder
@ 2010-06-02 21:58 ` Pedro Alves
2010-06-02 22:08 ` Joel Brobecker
0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2010-06-02 21:58 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches, Stan Shebs
On Wednesday 02 June 2010 20:42:48, Michael Snyder wrote:
> > I took a look at your patch.
> >
> >> -send_gdb "list $baseline, +12\n"
> >> -gdb_expect {
> >> +gdb_test_multiple "list $baseline, +12" "all tests in this module will fail" {
> >> -re "\[\r\n\](\[0-9\]+).*gdbtestline 1 " {
> >> set testline1 $expect_out(1,string)
> >> exp_continue
> >> @@ -108,7 +107,7 @@ all tests in this module will fail."
> >> untested backtrace.exp
> >> return -1
> >> all tests in this module will fail."
> >> - }
> >> + }
> >> }
> >>
> >
> > Can you do the return outside of gdb_test_multiple please?
> > I saw a few other instances in tfind.exp. Otherwise, looked fine.
>
> Done and committed. By the way, would you take a look at the
> diff just above? What is "all tests in this module will fail"
> doing there? The same thing appears in both backtrace.exp and
> report.exp.
>
Huh! It looks like it got left behind when somebody removed
gdb_supported_entire_file calls from these tests. I see things
like these in gdb 6.0:
gdb_expect {
-re "MIS-MATCHED.*$gdb_prompt $" {
gdb_suppress_entire_file "Symbol file does not match target!
all tests in this module will fail.";
}
--
Pedro Alves
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] gdb.trace/*.exp send_gdb vs. gdb_test
2010-06-02 21:58 ` Pedro Alves
@ 2010-06-02 22:08 ` Joel Brobecker
0 siblings, 0 replies; 10+ messages in thread
From: Joel Brobecker @ 2010-06-02 22:08 UTC (permalink / raw)
To: Pedro Alves; +Cc: Michael Snyder, gdb-patches, Stan Shebs
> Huh! It looks like it got left behind when somebody removed
> gdb_supported_entire_file calls from these tests. I see things
> like these in gdb 6.0:
>
> gdb_expect {
> -re "MIS-MATCHED.*$gdb_prompt $" {
> gdb_suppress_entire_file "Symbol file does not match target!
> all tests in this module will fail.";
> }
Ugh! (I hope it wasn't me - I remember talking about them a long while ago)
--
Joel
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-06-02 22:08 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-27 18:22 [RFA] gdb.trace/*.exp send_gdb vs. gdb_test Michael Snyder
2010-05-27 18:44 ` Pedro Alves
2010-05-27 19:14 ` Michael Snyder
2010-05-27 23:15 ` Pedro Alves
2010-05-27 23:25 ` Pedro Alves
2010-05-28 0:18 ` Michael Snyder
2010-05-29 0:41 ` Pedro Alves
2010-06-02 19:42 ` Michael Snyder
2010-06-02 21:58 ` Pedro Alves
2010-06-02 22:08 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox