summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/a2-run.exp6
-rw-r--r--gdb/testsuite/gdb.base/break.exp22
-rw-r--r--gdb/testsuite/gdb.base/call-ar-st.c2
-rw-r--r--gdb/testsuite/gdb.base/call-ar-st.exp5
-rw-r--r--gdb/testsuite/gdb.base/call-strs.exp8
-rw-r--r--gdb/testsuite/gdb.base/commands.exp54
-rw-r--r--gdb/testsuite/gdb.base/condbreak.exp8
-rw-r--r--gdb/testsuite/gdb.base/default.exp4
-rw-r--r--gdb/testsuite/gdb.base/display.exp6
-rw-r--r--gdb/testsuite/gdb.base/ena-dis-br.exp112
-rw-r--r--gdb/testsuite/gdb.base/ending-run.exp36
-rw-r--r--gdb/testsuite/gdb.base/miscexprs.c178
-rw-r--r--gdb/testsuite/gdb.base/miscexprs.exp10
-rw-r--r--gdb/testsuite/gdb.base/sigall.exp2
-rw-r--r--gdb/testsuite/gdb.base/signals.exp4
-rw-r--r--gdb/testsuite/gdb.base/smoke.exp2
-rw-r--r--gdb/testsuite/gdb.base/step-test.exp44
-rw-r--r--gdb/testsuite/gdb.base/watchpoint.exp12
18 files changed, 231 insertions, 284 deletions
diff --git a/gdb/testsuite/gdb.base/a2-run.exp b/gdb/testsuite/gdb.base/a2-run.exp
index 87a0edf293d..4341d27de25 100644
--- a/gdb/testsuite/gdb.base/a2-run.exp
+++ b/gdb/testsuite/gdb.base/a2-run.exp
@@ -109,7 +109,7 @@ if [istarget "*-*-vxworks*"] then {
verbose "Timeout is now $timeout seconds" 2
gdb_expect -re "$gdb_prompt $" {}
} else {
- setup_xfail "mips-idt-*" "arm-*-coff"
+ setup_xfail "mips-idt-*" "arm-*-coff strongarm-*-coff"
gdb_run_cmd 5
gdb_expect {
-re ".*120.*$gdb_prompt $"\
@@ -137,7 +137,7 @@ if [istarget "*-*-vxworks*"] then {
verbose "Timeout is now $timeout seconds" 2
gdb_expect -re "$gdb_prompt $" {}
} else {
- setup_xfail "arm-*-coff"
+ setup_xfail "arm-*-coff strongarm-*-coff"
gdb_expect {
-re ".*120.*$gdb_prompt $"\
{ pass "run \"$testfile\" again with same args" }
@@ -215,7 +215,7 @@ if [istarget "*-*-vxworks*"] then {
verbose "Timeout is now $timeout seconds" 2
gdb_expect -re "$gdb_prompt $" {}
} else {
- setup_xfail "arm-*-coff"
+ setup_xfail "arm-*-coff strongarm-*-coff"
gdb_expect {
-re ".*720.*$gdb_prompt $" {
pass "run \"$testfile\" again after setting args"
diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp
index b8f1d7f8fcb..300a4e630ae 100644
--- a/gdb/testsuite/gdb.base/break.exp
+++ b/gdb/testsuite/gdb.base/break.exp
@@ -574,12 +574,18 @@ gdb_expect {
}
# Verify that GDB responds gracefully to a request to "finish" from
-# the outermost frame.
+# the outermost frame. On a stub that never exits, this will just
+# run to the stubs routine, so we don't get this error... Thus the
+# second condition.
#
+
send_gdb "finish\n"
gdb_expect {
-re "\"finish\" not meaningful in the outermost frame.\r\n$gdb_prompt $"\
{pass "finish from outermost frame disallowed"}
+ -re "Run till exit from.*" {
+ pass "finish from outermost frame disallowed"
+ }
-re "$gdb_prompt $"\
{fail "finish from outermost frame disallowed"}
timeout {fail "(timeout) finish from outermost frame disallowed"}
@@ -743,18 +749,8 @@ proc test_next_with_recursion {} {
if { $result != 0 } { gdb_suppress_tests }
if [target_info exists gdb,noresults] { gdb_suppress_tests }
- if [target_info exists use_gdb_stub] {
- gdb_breakpoint "exit"
- gdb_test "continue" "Continuing..*Breakpoint .*exit \[(\].*=0\[)\].*" "continue until exit in recursive next test"
- } else {
- # Continue until we exit. Should not stop again.
- # Don't bother to check the output of the program, that may be
- # extremely tough for some remote systems.
- gdb_test "continue"\
- "Continuing.\[\r\n0-9\]+Program exited normally\\..*"\
- "continue until exit in recursive next test"
- }
- gdb_stop_suppressing_tests;
+ gdb_continue_to_end "recursive next test"
+ gdb_stop_suppressing_tests;
}
test_clear_command
diff --git a/gdb/testsuite/gdb.base/call-ar-st.c b/gdb/testsuite/gdb.base/call-ar-st.c
index c61977afb8e..bb30e507d59 100644
--- a/gdb/testsuite/gdb.base/call-ar-st.c
+++ b/gdb/testsuite/gdb.base/call-ar-st.c
@@ -994,7 +994,7 @@ int main () {
for (index = 0; index < 120; index++) {
if ((index%2) == 0) char_array[index] = 'Z';
else char_array[index] = 'a';
- } /* call-ar-st.exp uses line numbers everywhere */ char_array[120] = '\0';
+ } char_array[120] = '\0'; /* call-ar-st.exp uses line numbers everywhere */
for (index = 0; index < 100; index++) {
double_array[index] = index*23.4567;
diff --git a/gdb/testsuite/gdb.base/call-ar-st.exp b/gdb/testsuite/gdb.base/call-ar-st.exp
index d8ed4fef7dd..d408cf1f7f5 100644
--- a/gdb/testsuite/gdb.base/call-ar-st.exp
+++ b/gdb/testsuite/gdb.base/call-ar-st.exp
@@ -123,6 +123,7 @@ gdb_expect {
#call print_char_array(char_array)
+
send_gdb "print print_char_array(char_array)\n"
gdb_expect {
-re "array_c :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+Z\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa\[ \t\r\n\]+\[ \t\r\n\]+.*\[ \t\r\n\]+.*$gdb_prompt $" {
@@ -222,7 +223,7 @@ gdb_expect {
#step -over
send_gdb "next\n"
gdb_expect {
- -re "BYE BYE FOR NOW\[ \t\r\n\]+1035\[ \t\r\n\]+printf\\(.VERY GREEN GRASS.n.\\);\[ \t\r\n\]+.*$gdb_prompt $" { pass "next to 1035"}
+ -re "BYE BYE FOR NOW\[ \t\r\n\]main.*+1035\[ \t\r\n\]+printf\\(.VERY GREEN GRASS.n.\\);\[ \t\r\n\]+.*$gdb_prompt $" { pass "next to 1035"}
-re ".*$gdb_prompt $" { fail "next to 1035" }
timeout { fail "next to 1035(timeout)" }
}
@@ -235,7 +236,7 @@ gdb_expect {
pass "print print_array_rep(*list1, *list2, *list3)"
}
-re ".*$gdb_prompt $" { fail "print print_array_rep(*list1, *list2, *list3)" }
- timeout { fail "(timeout) print print_array_rep(*list1, *list2, *list3)"# }
+ timeout { fail "(timeout) print print_array_rep(*list1, *list2, *list3)" }
}
diff --git a/gdb/testsuite/gdb.base/call-strs.exp b/gdb/testsuite/gdb.base/call-strs.exp
index 20f358a3b63..1d4cc4a98ab 100644
--- a/gdb/testsuite/gdb.base/call-strs.exp
+++ b/gdb/testsuite/gdb.base/call-strs.exp
@@ -107,11 +107,11 @@ gdb_expect {
#step
-send_gdb "step\n"
+send_gdb "next\n"
gdb_expect {
- -re ".*str_func\\(\"abcd\", \"efgh\", \"ijkl\", \"mnop\", \"qrst\", \"uvwx\", \"yz12\"\\);.*$gdb_prompt $" {pass "step after strcpy"}
- -re ".*$gdb_prompt $" { fail "step after strcpy" }
- timeout { fail "step after strcpy (timeout)" }
+ -re ".*str_func\\(\"abcd\", \"efgh\", \"ijkl\", \"mnop\", \"qrst\", \"uvwx\", \"yz12\"\\);.*$gdb_prompt $" {pass "next over strcpy"}
+ -re ".*$gdb_prompt $" { fail "next over strcpy" }
+ timeout { fail "next over strcpy (timeout)" }
}
#print buf
diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp
index f70ac6b01d5..72356ec53c2 100644
--- a/gdb/testsuite/gdb.base/commands.exp
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -236,6 +236,55 @@ proc user_defined_command_test {} {
gdb_test "show user mycommand" "while.*set.*if.*p/x.*else.*p/x.*end.*" "display user command in user_defined_command_test"
}
+
+
+proc test_command_prompt_position {} {
+ global gdb_prompt
+
+ if [target_info exists noargs] {
+ verbose "Skipping test_command_prompt_position because of noargs."
+ return
+ }
+
+ if { ![runto factorial] } then { gdb_suppress_tests; }
+ # Don't depend upon argument passing, since most simulators don't currently
+ # support it. Bash value variable to be what we want.
+ delete_breakpoints
+ gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #2"
+ gdb_test "p value=5" "" "set value to 5 in test_command_prompt_position"
+ # All this test should do is print 0xdeadbeef once.
+ gdb_test "if value == 1\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" "\\\$\[0-9\]* = 0xdeadbeef" "if test in test_command_prompt_position"
+
+# Now let's test for the correct position of the '>' in gdb's prompt for commands.
+# It should be at the beginning of the line, and not after one space.
+
+ send_gdb "commands\n"
+ gdb_expect {
+ -re "Type commands.*End with.*\[\r\n\]>$" \
+ { send_gdb "printf \"Now the value is %d\\n\", value\n"
+ gdb_expect {
+ -re "^printf.*value\r\n>$" \
+ { send_gdb "end\n"
+ gdb_expect {
+ -re "^end\r\n$gdb_prompt $" { pass "> OK in test_command_prompt_position" }
+ -re ".*$gdb_prompt $" { fail "some other message in test_command_prompt_position" }
+ timeout { fail "(timeout) 1 in test_command_prompt_position" }
+ }
+ }
+ -re "^ >$" { fail "> not OK in test_command_prompt_position" }
+ -re ".*$gdb_prompt $" { fail "wrong message in test_command_prompt_position" }
+ timeout { fail "(timeout) 2 in test_command_prompt_position " }
+ }
+ }
+ -re "Type commands.*End with.*\[\r\n\] >$" { fail "prompt not OK in test_command_prompt_position" }
+ -re ".*$gdb_prompt $" { fail "commands in test_command_prompt_position" }
+ timeout { fail "(timeout) 3 commands in test_command_prompt_position" }
+ }
+
+ gdb_stop_suppressing_tests;
+}
+
+
gdbvar_simple_if_test
gdbvar_simple_while_test
gdbvar_complex_if_while_test
@@ -246,3 +295,8 @@ if_while_breakpoint_command_test
infrun_breakpoint_command_test
breakpoint_command_test
user_defined_command_test
+test_command_prompt_position
+
+
+
+
diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp
index 76f752181ec..cf9deba9c6f 100644
--- a/gdb/testsuite/gdb.base/condbreak.exp
+++ b/gdb/testsuite/gdb.base/condbreak.exp
@@ -118,11 +118,11 @@ gdb_test "info break" \
#
-# run until the breakpoint at main is hit. For non-stubs-using targets.
+# run until the breakpoint at main is hit.
#
-gdb_test "run" \
- "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:60.*60\[\t \]+if .argc.* \{.*" \
-"run until function breakpoint"
+
+
+gdb_run_cmd
#
# run until the breakpoint at a line number
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 8e1506aeb02..2a342aa5abc 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -40,6 +40,8 @@ gdb_expect {
{ pass "attach" }
-re "You can't do that when your target is `None'.*$gdb_prompt $"\
{ pass "attach" }
+ -re "You can't do that without a process to debug.*$gdb_prompt $"\
+ { pass "attach" }
-re "Don't know how to attach. Try \"help target\"..*$gdb_prompt $"\
{ pass "attach" }
-re "Kill it. .y or n." {
@@ -295,6 +297,8 @@ if [istarget "arm-*-*"] then {
gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
} elseif [istarget "thumb-*-*"] then {
gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
+} elseif [istarget "strongarm-*-*"] then {
+ gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
} else {
gdb_test "info float" "No floating point info available for this processor." "info float"
}
diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp
index f5c2641226d..638072c2baa 100644
--- a/gdb/testsuite/gdb.base/display.exp
+++ b/gdb/testsuite/gdb.base/display.exp
@@ -49,8 +49,10 @@ gdb_load ${binfile}
# Ok, on to real life
#
-gdb_test "b main" ".*Breakpoint 1.*" "break main"
-gdb_test "r" ".*Breakpoint 1, main.*" "get to main"
+
+if {![runto main]} {
+ fail "Could not run to main - other tests will fail."
+}
gdb_test "b 14" ".*Breakpoint 2.*" "break do_loops"
gdb_test "c" ".*Breakpoint 2, do_loops.*" "get to do_loops"
diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp
index 6593d824294..f5656d849a2 100644
--- a/gdb/testsuite/gdb.base/ena-dis-br.exp
+++ b/gdb/testsuite/gdb.base/ena-dis-br.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -38,6 +38,30 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
+proc rerun_to_main {} {
+ global gdb_prompt
+
+ if [target_info exists use_gdb_stub] {
+ gdb_run_cmd
+ gdb_expect {
+ -re ".*Breakpoint .*main .*$gdb_prompt $"\
+ {pass "rerun to main" ; return 0}
+ -re "$gdb_prompt $"\
+ {fail "rerun to main" ; return 0}
+ timeout {fail "(timeout) rerun to main" ; return 0}
+ }
+ } else {
+ send_gdb "run\n"
+ gdb_expect {
+ -re "Starting program.*$gdb_prompt $"\
+ {pass "rerun to main" ; return 0}
+ -re "$gdb_prompt $"\
+ {fail "rerun to main" ; return 0}
+ timeout {fail "(timeout) rerun to main" ; return 0}
+ }
+ }
+}
+
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
@@ -137,32 +161,9 @@ gdb_expect {
# Verify that we don't stop at a disabled breakpoint.
#
-send_gdb "continue\n"
-gdb_expect {
- -re ".*Program exited normally.*$gdb_prompt $"\
- {pass "no stop"}
- -re "$gdb_prompt $"\
- {fail "no stop"}
- timeout {fail "(timeout) no stop"}
-}
-
-send_gdb "run\n"
-gdb_expect {
- -re "Starting program.*$gdb_prompt $"\
- {pass "rerun to main"}
- -re "$gdb_prompt $"\
- {fail "rerun to main"}
- timeout {fail "(timeout) rerun to main"}
-}
-
-send_gdb "continue\n"
-gdb_expect {
- -re ".*Program exited normally.*$gdb_prompt $"\
- {pass "no stop at auto-disabled break marker2"}
- -re "$gdb_prompt $"\
- {fail "no stop at auto-disabled break marker2"}
- timeout {fail "(timeout) no stop at auto-disabled break marker2"}
-}
+gdb_continue_to_end "no stop"
+rerun_to_main
+gdb_continue_to_end "no stop at auto-disabled break marker2"
# Verify that we can set a breakpoint to be self-deleting after
# the first time it triggers.
@@ -321,23 +322,8 @@ gdb_expect {
timeout {fail "(timeout) info ignored break marker1"}
}
-send_gdb "continue\n"
-gdb_expect {
- -re ".*Program exited normally.*$gdb_prompt $"\
- {pass "no stop at ignored break marker1"}
- -re "$gdb_prompt $"\
- {fail "no stop at ignored break marker1"}
- timeout {fail "(timeout) no stop at ignored break marker1"}
-}
-
-send_gdb "run\n"
-gdb_expect {
- -re "Starting program.*$gdb_prompt $"\
- {pass "rerun to main"}
- -re "$gdb_prompt $"\
- {fail "rerun to main"}
- timeout {fail "(timeout) rerun to main"}
-}
+gdb_continue_to_end "no stop at ignored break marker1"
+rerun_to_main
send_gdb "continue\n"
gdb_expect {
@@ -386,23 +372,8 @@ gdb_expect {
timeout {fail "(timeout) info break marker2"}
}
-send_gdb "continue\n"
-gdb_expect {
- -re ".*Program exited normally.*$gdb_prompt $"\
- {pass "no stop at ignored & auto-deleted break marker1"}
- -re "$gdb_prompt $"\
- {fail "no stop at ignored & auto-deleted break marker1"}
- timeout {fail "(timeout) no stop at ignored & auto-deleted break marker1"}
-}
-
-send_gdb "run\n"
-gdb_expect {
- -re "Starting program.*$gdb_prompt $"\
- {pass "rerun to main"}
- -re "$gdb_prompt $"\
- {fail "rerun to main"}
- timeout {fail "(timeout) rerun to main"}
-}
+gdb_continue_to_end "no stop at ignored & auto-deleted break marker1"
+rerun_to_main
send_gdb "continue\n"
gdb_expect {
@@ -445,23 +416,8 @@ gdb_expect {
timeout {fail "(timeout) disable break marker1"}
}
-send_gdb "continue\n"
-gdb_expect {
- -re ".*Program exited normally.*$gdb_prompt $"\
- {pass "no stop at ignored & disabled break marker1"}
- -re "$gdb_prompt $"\
- {fail "no stop at ignored & disabled break marker1"}
- timeout {fail "(timeout) no stop at ignored & disabled break marker1"}
-}
-
-send_gdb "run\n"
-gdb_expect {
- -re "Starting program.*$gdb_prompt $"\
- {pass "rerun to main"}
- -re "$gdb_prompt $"\
- {fail "rerun to main"}
- timeout {fail "(timeout) rerun to main"}
-}
+gdb_continue_to_end "no stop at ignored & disabled break marker1"
+rerun_to_main
send_gdb "info break $expect_out(1,string)\n"
gdb_expect {
diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
index 61b42c75712..da78e3be98e 100644
--- a/gdb/testsuite/gdb.base/ending-run.exp
+++ b/gdb/testsuite/gdb.base/ending-run.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999 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
@@ -61,7 +61,11 @@ gdb_test "b 26" ".*Breakpoint.*3.*" ""
# Expect to hit the bp at line "1", but symbolize this
# as line "8". Then try to clear it--this should work.
#
-gdb_test "r" ".*Breakpoint.*1.*callee.*8.*" ""
+if [target_info exists use_gdb_stub] {
+ gdb_test "continue" ".*Breakpoint.*1.*callee.*8.*" ""
+} else {
+ gdb_test "r" ".*Breakpoint.*1.*callee.*8.*" ""
+}
gdb_test "cle" ".*Deleted breakpoints 2 1.*" "clear worked"
send_gdb "i b\n"
gdb_expect {
@@ -147,24 +151,30 @@ gdb_expect {
-re ".*in.*start.*$gdb_prompt $" {
pass "step out of main"
}
+ -re ".*Program received signal SIGTRAP.*$gdb_prompt $" {
+ pass "Cygmon stopped in ending trap."
+ }
timeout { fail "hang or timeout on step at end 1" }
}
-gdb_test "n" ".*Single.*Program exited.*" "step to end of run"
-set timeout $old_timeout
-
-gdb_test "n" ".*The program is not being run.*" "don't step after run"
-
-set exec_output [remote_exec host "ls core"]
-
-if [ regexp "core not found" $exec_output] {
+if {![target_info exists use_cygmon] || ![target_info use_cygmon]} {
+ gdb_test "n" ".*Single.*Program exited.*" "step to end of run"
+ set timeout $old_timeout
+
+ gdb_test "n" ".*The program is not being run.*" "don't step after run"
+
+ set exec_output [remote_exec host "ls core"]
+
+
+ if [ regexp "core not found" $exec_output] {
pass "No core dumped on quit"
-} else {
- if [ regexp "No such file or directory" $exec_output] {
- pass "ls: core: No core dumped on quit"
} else {
+ if [ regexp "No such file or directory" $exec_output] {
+ pass "ls: core: No core dumped on quit"
+ } else {
remote_exec build "rm -f core"
fail "Core dumped on quit"
+ }
}
}
diff --git a/gdb/testsuite/gdb.base/miscexprs.c b/gdb/testsuite/gdb.base/miscexprs.c
index cae23d8cf33..41bd29f6485 100644
--- a/gdb/testsuite/gdb.base/miscexprs.c
+++ b/gdb/testsuite/gdb.base/miscexprs.c
@@ -1,165 +1,49 @@
-void marker1 ()
+void
+marker1 ()
{
-
+
}
-/*
-static struct {
- char c[100];
-} cbig;
-
-
-static struct {
- int i[800];
-} ibig;
-
-
-static struct {
- long l[900];
-} lbig;
-
-static struct {
- float f[200];
-} fbig;
-
-static struct {
- double d[300];
-} dbig;
-
-static struct {
- short s[400];
-} sbig;*/
-/*struct {
- long l[900];
-} lbig;*/
-
-int main()
+int
+main ()
{
-
-struct {
+ struct {
char c[100];
-} cbig;
-
+ } cbig;
-struct {
+ struct {
int i[800];
-} ibig;
+ } ibig;
-
-struct {
+ struct {
long l[900];
-} lbig;
+ } lbig;
-struct {
+ struct {
float f[200];
-} fbig;
+ } fbig;
-struct {
+ struct {
double d[300];
-} dbig;
+ } dbig;
-struct {
+ struct {
short s[400];
-} sbig;
- ibig.i[100] = 5;
- cbig.c[100] = 'A';
- fbig.f[100] = 11.99999;
- dbig.d[202] = 9.99999999;
- sbig.s[90] = 255;
- lbig.l[333] = 999999999;
+ } sbig;
+
+ ibig.i[100] = 5;
+ cbig.c[0] = '\0';
+ cbig.c[100] = 'A';
+ fbig.f[100] = 11.99999;
+ dbig.d[202] = 9.99999999;
+ sbig.s[90] = 255;
+ lbig.l[333] = 999999999;
- #ifdef usestubs
- set_debug_traps();
- breakpoint();
- #endif
- marker1();
- return 0;
+#ifdef usestubs
+ set_debug_traps ();
+ breakpoint ();
+#endif
+ marker1 ();
+ return 0;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gdb/testsuite/gdb.base/miscexprs.exp b/gdb/testsuite/gdb.base/miscexprs.exp
index 9ea278a570f..d42e5abbfbb 100644
--- a/gdb/testsuite/gdb.base/miscexprs.exp
+++ b/gdb/testsuite/gdb.base/miscexprs.exp
@@ -114,18 +114,24 @@ gdb_expect {
send_gdb "print &sbig.s\[0\]\n"
gdb_expect {
+ -re ".\[0-9\]* = \\(short \\*\\) $hex.*$gdb_prompt $" {
+ pass "print value of &sbig.s\[0\]"
+ }
-re ".\[0-9\]* = \\(short int \\*\\) $hex.*$gdb_prompt $" {
pass "print value of &sbig.s\[0\]"
- }
+ }
-re ".*$gdb_prompt $" { fail "print value of &sbig.s\[0\]" }
timeout { fail "(timeout) print value of &sbig.s\[0\]" }
}
send_gdb "print &lbig.l\[0\]\n"
gdb_expect {
+ -re ".\[0-9\]* = \\(long \\*\\) $hex.*$gdb_prompt $" {
+ pass "print value of &lbig.l\[0\]"
+ }
-re ".\[0-9\]* = \\(long int \\*\\) $hex.*$gdb_prompt $" {
pass "print value of &lbig.l\[0\]"
- }
+ }
-re ".*$gdb_prompt $" { fail "print value of &lbig.l\[0\]" }
timeout { fail "(timeout) print value of &lbig.l\[0\]" }
}
diff --git a/gdb/testsuite/gdb.base/sigall.exp b/gdb/testsuite/gdb.base/sigall.exp
index 765e0ee5df9..75599789c78 100644
--- a/gdb/testsuite/gdb.base/sigall.exp
+++ b/gdb/testsuite/gdb.base/sigall.exp
@@ -205,6 +205,6 @@ gdb_test "continue" \
"Continuing.*Program received signal SIGTERM.*" \
"get signal TERM"
gdb_test "continue" "Breakpoint.*handle_TERM.*" "send signal TERM"
-gdb_test "continue" "Program exited normally\\." "continue to sigall exit"
+gdb_continue_to_end "continue to sigall exit"
return 0
diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp
index 49bf49081b0..16528f731d3 100644
--- a/gdb/testsuite/gdb.base/signals.exp
+++ b/gdb/testsuite/gdb.base/signals.exp
@@ -336,7 +336,9 @@ proc test_handle_all_print {} {
set oldtimeout $timeout
set timeout [expr "$timeout + 360"]
verbose "Timeout is now $timeout seconds" 2
- if { [istarget "*-*-gnu*"] || [istarget "*-*-mach*"] } {
+ if { ![istarget "*-*-linux*"]
+ && ( [istarget "*-*-gnu*"]
+ || [istarget "*-*-mach*"] ) } {
gdb_test "handle all print" "Signal\[ \]+Stop\[ \]+Print\[ \]+Pass to program\[ \]+Description\r\nSIGHUP\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Hangup.*SIG63\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Real-time event 63.*EXC_BREAKPOINT\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Breakpoint"
} else {
gdb_test "handle all print" "Signal\[ \]+Stop\[ \]+Print\[ \]+Pass to program\[ \]+Description\r\nSIGHUP\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Hangup.*SIG63\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Real-time event 63"
diff --git a/gdb/testsuite/gdb.base/smoke.exp b/gdb/testsuite/gdb.base/smoke.exp
index 42de7c891f1..af107e05abd 100644
--- a/gdb/testsuite/gdb.base/smoke.exp
+++ b/gdb/testsuite/gdb.base/smoke.exp
@@ -58,7 +58,7 @@ gdb_test "r" ".*Starting program.*main.*15.*" "hit bp"
gdb_test "hel r" ".*Start debugged program.*without arguments.*" "help"
gdb_test "n" ".*x = 1;.*" "next"
gdb_test "s" ".*y = 2;.*" "step"
-gdb_test "p/t y" ".* = 1.*" "print y in binary"
+gdb_test "p/t x" ".* = 1.*" "print x in binary"
gdb_test "p 1+2*3+4" ".* = 11.*" "calculate"
gdb_test "p/t 1+2*3+4" ".* = 1011.*" "binary"
diff --git a/gdb/testsuite/gdb.base/step-test.exp b/gdb/testsuite/gdb.base/step-test.exp
index 415714d81e4..85744d73865 100644
--- a/gdb/testsuite/gdb.base/step-test.exp
+++ b/gdb/testsuite/gdb.base/step-test.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999 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
@@ -46,6 +46,9 @@ if ![runto_main] then {
return 0
}
+# Set a breakpoint at line 45, if stepi then finish fails, we would
+# run to the end of the program, which would mess up the rest of the tests.
+
# Vanilla step/next
#
gdb_test "next" ".*${decimal}.*x = 1;.*" "next 1"
@@ -127,8 +130,41 @@ test_i "stepi to next line" "stepi" \
".*${decimal}.*callee.*STEPI"
test_i "stepi into function" "stepi" \
".*${decimal}.*callee.*STEPI" \
- ".*callee \\(\\) at .*step-test\\.c"
-gdb_test "finish" ".*${decimal}.*callee.*NEXTI.*" "stepi: finish call"
+ ".*callee \\(\\) at .*step-test\\.c"
+# Have to be careful here, if the finish does not work,
+# then we may run to the end of the program, which
+# will cause erroneous failures in the rest of the tests
+
+send_gdb "finish\n"
+gdb_expect {
+ -re ".*(Program received|Program exited).*$gdb_prompt $" {
+ puts "*** Matched Program recieved"
+ # Oops... We ran to the end of the program... Better reset
+ if {![runto_main]} then {
+ fail "Can't run to main"
+ return 0
+ }
+ if {![runto step-test.c:45]} {
+ fail "Can't run to line 45"
+ return 0
+ }
+ fail "stepi: finish call"
+ }
+ -re ".*${decimal}.*callee.*NEXTI.*$gdb_prompt $" {
+ puts "*** Matched success..."
+ pass "stepi: finish call"
+ }
+ -re "$gdb_prompt $" {
+ # We got something else. Fail.
+ fail "stepi: finish call"
+ return
+ }
+ timeout {
+ fail "stepi: finish call"
+ return
+ }
+}
+
test_i "nexti over function" "nexti" \
".*${decimal}.*callee.*NEXTI" \
".*${decimal}.*y = w \\+ z;"
@@ -148,6 +184,6 @@ gdb_test "step" \
".*step-test.exp: arrive here 1.*" \
"large struct by value"
-gdb_test "continue" ".*Program exited normally.*" "run to finish"
+gdb_continue_to_end "step-test.exp"
return 0
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
index a2954452cd1..53f2e8b03a0 100644
--- a/gdb/testsuite/gdb.base/watchpoint.exp
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -209,8 +209,7 @@ Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count
if [target_info exists gdb,noresults] { return }
- gdb_test "cont" "Continuing.*Program exited normally.*" \
- "continue to exit in test_simple_watchpoint"
+ gdb_continue_to_end "continue to exit in test_simple_watchpoint"
}
# Test disabling watchpoints.
@@ -280,8 +279,7 @@ proc test_disabling_watchpoints {} {
if [target_info exists gdb,noresults] { return }
- gdb_test "cont" "Continuing.*Program exited normally.*" \
- "continue to exit in test_disabling_watchpoints"
+ gdb_continue_to_end "continue to exit in test_disabling_watchpoints"
}
# Test stepping and other mundane operations with watchpoints enabled
@@ -475,8 +473,7 @@ proc test_watchpoint_triggered_in_syscall {} {
if [target_info exists gdb,noresults] { return }
- gdb_test "cont" "Continuing.*Program exited normally.*" \
- "continue to exit in test_watchpoint_triggered_in_syscall"
+ gdb_continue_to_end "continue to exit in test_watchpoint_triggered_in_syscall"
}
}
@@ -504,8 +501,7 @@ proc test_complex_watchpoint {} {
if [target_info exists gdb,noresults] { return }
- gdb_test "cont" "Continuing.*Program exited normally.*" \
- "continue to exit in test_complex_watchpoint"
+ gdb_continue_to_end "continue to exit in test_complex_watchpoint"
}
}