aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2010-06-02 19:41:11 +0000
committerMichael Snyder <msnyder@vmware.com>2010-06-02 19:41:11 +0000
commit0ab48859b9a642d6393ccb0c43bda33360b83750 (patch)
tree5c23eb8063438843a1cca824ffd7f29c36a1b7af
parent9eae7c5264c14e142dd52988f70d58f62755b2d0 (diff)
downloadgdb-0ab48859b9a642d6393ccb0c43bda33360b83750.zip
gdb-0ab48859b9a642d6393ccb0c43bda33360b83750.tar.gz
gdb-0ab48859b9a642d6393ccb0c43bda33360b83750.tar.bz2
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.
-rw-r--r--gdb/testsuite/gdb.trace/actions.exp6
-rw-r--r--gdb/testsuite/gdb.trace/backtrace.exp55
-rw-r--r--gdb/testsuite/gdb.trace/collection.exp9
-rw-r--r--gdb/testsuite/gdb.trace/deltrace.exp65
-rw-r--r--gdb/testsuite/gdb.trace/infotrace.exp16
-rw-r--r--gdb/testsuite/gdb.trace/report.exp46
-rw-r--r--gdb/testsuite/gdb.trace/save-trace.exp3
-rw-r--r--gdb/testsuite/gdb.trace/tfind.exp43
-rw-r--r--gdb/testsuite/gdb.trace/tracecmd.exp22
-rw-r--r--gdb/testsuite/gdb.trace/tsv.exp20
10 files changed, 99 insertions, 186 deletions
diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trace/actions.exp
index 0c27d84..c805a0a 100644
--- a/gdb/testsuite/gdb.trace/actions.exp
+++ b/gdb/testsuite/gdb.trace/actions.exp
@@ -66,8 +66,7 @@ if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
# 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 used at the top level." \
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"
}
diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp
index b3a5de1..ae4e628 100644
--- a/gdb/testsuite/gdb.trace/backtrace.exp
+++ b/gdb/testsuite/gdb.trace/backtrace.exp
@@ -71,8 +71,9 @@ if { $baseline == -1 } {
return;
}
-send_gdb "list $baseline, +12\n"
-gdb_expect {
+set return_me 0
+
+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
@@ -100,15 +101,19 @@ gdb_expect {
-re ".*$gdb_prompt $" {
if { ($testline1 == 0) || ($testline2 == 0) || ($testline3 == 0) || ($testline4 == 0) || ($testline5 == 0) || ($testline6 == 0) } {
untested backtrace.exp
- return -1
+ set return_me 1
all tests in this module will fail."
}
}
default {
untested backtrace.exp
- return -1
+ set return_me 1
all tests in this module will fail."
- }
+ }
+}
+
+if { $return_me == 1 } then {
+ return -1;
}
#
@@ -177,16 +182,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 +196,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 +208,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 +227,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 +237,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)" }
}
}
diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp
index 0a3f997..ffa7eb7 100644
--- a/gdb/testsuite/gdb.trace/collection.exp
+++ b/gdb/testsuite/gdb.trace/collection.exp
@@ -292,8 +292,7 @@ proc gdb_collect_locals_test { func mylocs msg } {
# 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 expr val msg } {
# 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"
diff --git a/gdb/testsuite/gdb.trace/deltrace.exp b/gdb/testsuite/gdb.trace/deltrace.exp
index 4c0014c..21fa254 100644
--- a/gdb/testsuite/gdb.trace/deltrace.exp
+++ b/gdb/testsuite/gdb.trace/deltrace.exp
@@ -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." \
diff --git a/gdb/testsuite/gdb.trace/infotrace.exp b/gdb/testsuite/gdb.trace/infotrace.exp
index 8130553..bfe8794 100644
--- a/gdb/testsuite/gdb.trace/infotrace.exp
+++ b/gdb/testsuite/gdb.trace/infotrace.exp
@@ -76,15 +76,15 @@ gdb_test "info tracepoint [expr $c_test_num + $asm_test_num]" \
"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" \
diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp
index ed9ef51..b9cec99 100644
--- a/gdb/testsuite/gdb.trace/report.exp
+++ b/gdb/testsuite/gdb.trace/report.exp
@@ -76,8 +76,9 @@ if { $gdb_recursion_test_baseline == -1 } {
return;
}
-send_gdb "list $gdb_recursion_test_baseline, +12\n"
-gdb_expect {
+set return_me 0
+
+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
@@ -105,17 +106,21 @@ gdb_expect {
-re ".*$gdb_prompt $" {
if { ($testline1 == 0) || ($testline2 == 0) || ($testline3 == 0) || ($testline4 == 0) || ($testline5 == 0) || ($testline6 == 0) } {
untested report.exp
- return -1
+ set return_me 1
all tests in this module will fail."
}
}
default {
untested report.exp
- return -1
+ set return_me 1
all tests in this module will fail."
}
}
+if { $return_me == 1 } then {
+ return -1;
+}
+
#
# Setup trace experiment. This will involve:
# 1) a tracepoint where nothing is collected
@@ -273,20 +278,13 @@ gdb_test "printf \"x %d x\\n\", \$tracepoint" "x $tdp1 x" \
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 +294,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 +326,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 +334,7 @@ gdb_tfind_test "12.2: find first TDP #2 frame" "tracepoint $tdp2" \
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 +346,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 +354,7 @@ gdb_tfind_test "12.3: find first TDP #3 frame" "tracepoint $tdp3" \
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 +366,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 +374,7 @@ gdb_tfind_test "12.4: find first TDP #6 frame" "tracepoint $tdp6" \
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 +386,6 @@ gdb_expect {
pass "12.4: trace report #4"
}
}
- timeout {
- fail "12.4: trace report #4 (timeout)"
- }
}
# Finished!
diff --git a/gdb/testsuite/gdb.trace/save-trace.exp b/gdb/testsuite/gdb.trace/save-trace.exp
index e527800..8c18d03 100644
--- a/gdb/testsuite/gdb.trace/save-trace.exp
+++ b/gdb/testsuite/gdb.trace/save-trace.exp
@@ -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";
diff --git a/gdb/testsuite/gdb.trace/tfind.exp b/gdb/testsuite/gdb.trace/tfind.exp
index 49f2210..04e670f 100644
--- a/gdb/testsuite/gdb.trace/tfind.exp
+++ b/gdb/testsuite/gdb.trace/tfind.exp
@@ -83,29 +83,28 @@ if { $tdp1 <= 0 || $tdp2 <= 0 || $tdp3 <= 0 || \
}
# 6.1 test tstart command
-send_gdb "tstart\n"
-gdb_expect {
+
+set return_me 1
+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;
}
-re "Target does not support this command.*$gdb_prompt $" {
fail "6.1: tstart (connected to wrong target?)"
- return;
}
-re "Target returns error code.*$gdb_prompt $" {
fail "6.1: tstart (connected to wrong target?)"
- return;
}
-re "$gdb_prompt $" {
pass "6.1: tstart"
- }
- default {
- fail "6.1: tstart (default)"
- return;
+ set return_me 0
}
}
+if { $return_me == 1 } then {
+ return -1;
+}
+
# test tstatus (when trace on)
gdb_test "tstatus" "\[Tt\]race is running.*" "test tstatus on"
@@ -118,27 +117,26 @@ gdb_test "continue" \
"run trace experiment"
# 7.1 test tstop command
-send_gdb "tstop\n"
-gdb_expect {
+
+set return_me 1
+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;
}
-re "Target does not support this command.*$gdb_prompt $" {
fail "7.1: tstop (connected to wrong target?)"
- return;
}
-re "Target returns error code.*$gdb_prompt $" {
fail "7.1: tstop (connected to wrong target?)"
- return;
}
-re "$gdb_prompt $" {
pass "7.1: tstop"
+ set return_me 0
}
- default {
- fail "7.1: tstop (default)"
- return;
- }
+}
+
+if { $return_me == 1 } then {
+ return -1;
}
# 7.2 test help tstop
@@ -329,13 +327,10 @@ gdb_tfind_test "8.17: tfind line <no arg>" "line" "\$trace_line != $testline3" "
# 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.*" \
diff --git a/gdb/testsuite/gdb.trace/tracecmd.exp b/gdb/testsuite/gdb.trace/tracecmd.exp
index 624ca55..5590f88 100644
--- a/gdb/testsuite/gdb.trace/tracecmd.exp
+++ b/gdb/testsuite/gdb.trace/tracecmd.exp
@@ -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.*gdb_asm_test.*" \
# 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
@@ -165,12 +161,12 @@ gdb_test "help trace" "Set a tracepoint at .*" "1.14: help trace"
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"
+ }
}
diff --git a/gdb/testsuite/gdb.trace/tsv.exp b/gdb/testsuite/gdb.trace/tsv.exp
index 3cd8ad5..6829d76 100644
--- a/gdb/testsuite/gdb.trace/tsv.exp
+++ b/gdb/testsuite/gdb.trace/tsv.exp
@@ -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.*" \