aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2010-05-24 22:03:59 +0000
committerMichael Snyder <msnyder@vmware.com>2010-05-24 22:03:59 +0000
commitad3986f07b99393eb3a6282381d82cc1e8fe02fd (patch)
tree2fae34b761d0bc691347934f28d60eba28bbd03c /gdb/testsuite/gdb.base/call-rt-st.exp
parent2010-05-24 Tristan Gingold <gingold@adacore.com> (diff)
downloadbinutils-gdb-ad3986f07b99393eb3a6282381d82cc1e8fe02fd.tar.gz
binutils-gdb-ad3986f07b99393eb3a6282381d82cc1e8fe02fd.tar.bz2
binutils-gdb-ad3986f07b99393eb3a6282381d82cc1e8fe02fd.zip
2010-05-24 Michael Snyder <msnyder@vmware.com>
* gdb.base/call-ar-st.exp: Replace send_gdb with gdb_test. * gdb.base/callfuncs.exp: Replace send_gdb with gdb_test. * gdb.base/call-rt-st.exp: Replace send_gdb with gdb_test. * gdb.base/call-signal-resume.exp: Replace send_gdb with gdb_test. * gdb.base/call-strs.exp: Replace send_gdb with gdb_test. * gdb.base/catch-syscall.exp: Replace send_gdb with gdb_test. * gdb.base/charset.exp: Replace send_gdb with gdb_test. * gdb.base/checkpoint.exp: Replace send_gdb with gdb_test. * gdb.base/commands.exp: Replace send_gdb with gdb_test. * gdb.base/condbreak.exp: Replace send_gdb with gdb_test. * gdb.base/cond-exprs.exp: Replace send_gdb with gdb_test. * gdb.base/consecutive.exp: Replace send_gdb with gdb_test. * gdb.base/constvars.exp: Replace send_gdb with gdb_test. * gdb.base/corefile.exp: Replace send_gdb with gdb_test.
Diffstat (limited to 'gdb/testsuite/gdb.base/call-rt-st.exp')
-rw-r--r--gdb/testsuite/gdb.base/call-rt-st.exp66
1 files changed, 9 insertions, 57 deletions
diff --git a/gdb/testsuite/gdb.base/call-rt-st.exp b/gdb/testsuite/gdb.base/call-rt-st.exp
index 593b375f3c6..58c0eeed10d 100644
--- a/gdb/testsuite/gdb.base/call-rt-st.exp
+++ b/gdb/testsuite/gdb.base/call-rt-st.exp
@@ -58,44 +58,15 @@ if [target_info exists gdb,cannot_call_functions] {
continue
}
-# Set the current language to C. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_c {} {
- global gdb_prompt
-
- send_gdb "set language c\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language c (timeout)" ; return 0; }
- }
-
- send_gdb "show language\n"
- gdb_expect {
- -re ".* source language is \"c\".*$gdb_prompt $" {
- pass "set language to \"c\""
- return 1
- }
- -re ".*$gdb_prompt $" {
- fail "setting language to \"c\""
- return 0
- }
- timeout {
- fail "can't show language (timeout)"
- return 0
- }
- }
-}
-
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
-send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
-send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $"
-send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
+gdb_test_no_output "set print sevenbit-strings"
+gdb_test_no_output "set print address off"
+gdb_test_no_output "set width 0"
if ![runto_main] then {
@@ -108,29 +79,17 @@ gdb_test "break loop_count" \
"Breakpoint.* file .*call-rt-st.c, line 128\\." \
"breakpoint loop_count"
+gdb_test "continue" \
+ "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+128\[\t \]+for \\(index=0; index.4; index..\\);\[\r\n \]+" \
+ "continue to loop_count"
-send_gdb "continue\n"
-gdb_expect {
- -re "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+128\[\t \]+for \\(index=0; index.4; index..\\);\[\r\n \]+$gdb_prompt $" {
- pass "continue to loop_count"}
- -re ".*$gdb_prompt $" { fail "continue to loop_count"}
- timeout { fail "(timeout) continue to loop_count"}
-}
-
-send_gdb "finish\n"
-gdb_expect {
- -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:777\[ \t\r\n\]+777\[\t \]+return 0;.*$gdb_prompt $" {
+gdb_test_multiple "finish" "finish out from loop count" {
+ -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:777\[ \t\r\n\]+777\[\t \]+return 0;.*$gdb_prompt $" {
pass "finish out from loop_count (line 777)"
}
-re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:775\[ \t\r\n\]+775\[\t \]+loop_count.*$gdb_prompt $" {
pass "finish out from loop_count (line 775)"
}
- -re ".*$gdb_prompt $" {
- fail "finish out from loop_count"
- }
- timeout {
- fail "finish out from loop_count (timeout)"
- }
}
# Ask GDB to print the value of EXPR, and expect to see the regexp
@@ -142,20 +101,13 @@ proc print_struct_call { expr result } {
global gdb_prompt
set command "print $expr"
- send_gdb "${command}\n"
- gdb_expect {
+ gdb_test_multiple "${command}" "${command}" {
-re "$result\[\r\n\]+$gdb_prompt $" {
pass "$command"
}
-re "Function return value unknown.\[\r\n\]+$gdb_prompt $" {
unsupported "$command"
}
- -re "$gdb_prompt $" {
- fail "$command"
- }
- timeout {
- fail "$command (timeout)"
- }
}
}