aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1995-01-25 03:33:25 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1995-01-25 03:33:25 +0000
commit6535b97b3f8c3a6cb92b106e8cfbb7e7896c5df4 (patch)
treefe2518ef5085920c6f0b416156d84b5e96cf3591 /gdb/testsuite/gdb.base
parentc1ac88f9d57c02f20124cb76e2609c864da008b4 (diff)
downloadgdb-6535b97b3f8c3a6cb92b106e8cfbb7e7896c5df4.zip
gdb-6535b97b3f8c3a6cb92b106e8cfbb7e7896c5df4.tar.gz
gdb-6535b97b3f8c3a6cb92b106e8cfbb7e7896c5df4.tar.bz2
* lib/gdb.exp (gdb_test): Remove catch from around the send. The
code following the catch silently ignored some errors; without the catch they should be thrown like any other tcl error. Also, the catch used "" instead of {} which meant all the callers who wanted to include one of the characters "[]$ had to quote it an extra time. * gdb.base/{callfuncs.exp,commands.exp,gdbvars.exp,printcmds.exp, ptype.exp,signals.exp,watchpoint.exp}, gdb.c++/{cplusfuncs.exp, demangle.exp}, gdb.chill/chexp.exp, gdb.fortran/exprs.exp: Remove extra quoting.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/signals.exp93
1 files changed, 47 insertions, 46 deletions
diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp
index 0bd0914..f91b7a9 100644
--- a/gdb/testsuite/gdb.base/signals.exp
+++ b/gdb/testsuite/gdb.base/signals.exp
@@ -224,60 +224,61 @@ if {[ istarget "m68*-motorola-*" ] || [ istarget "hppa*-*-bsd*" ] ||
return 0
}
-{
- gdb_load $binfile
- signal_tests_1
-
- # Force a resync, so we're looking at the right prompt. On SCO we
- # were getting out of sync (I don't understand why).
- send "p 1+1\n"
- expect {
- -re "= 2.*$prompt $" {}
- -re ".*$prompt $" { perror "sync trouble in signals.exp" }
- default { perror "sync trouble in signals.exp" }
- }
+gdb_exit
+gdb_start
+gdb_load $binfile
+signal_tests_1
+
+# Force a resync, so we're looking at the right prompt. On SCO we
+# were getting out of sync (I don't understand why).
+send "p 1+1\n"
+expect {
+ -re "= 2.*$prompt $" {}
+ -re ".*$prompt $" { perror "sync trouble in signals.exp" }
+ default { perror "sync trouble in signals.exp" }
+}
- if [runto main] then {
- gdb_test "break handler if 0" "Breakpoint \[0-9\]*"
- gdb_test "set \\\$handler_breakpoint_number = \\\$bpnum" ""
-
- # Get to the point where a signal is waiting to be delivered
- gdb_test "next" "signal \[(\]+SIGUSR1"
- gdb_test "next" "alarm \[(\]+"
- gdb_test "next" "\[+\]+count"
- # Give the signal time to get delivered
- exec sleep 2
+if [runto main] then {
+ gdb_test "break handler if 0" "Breakpoint \[0-9\]*"
+ gdb_test "set \$handler_breakpoint_number = \$bpnum" ""
- # Now call a function. When GDB tries to run the stack dummy,
- # it will hit the breakpoint at handler. Provided it doesn't
- # lose its cool, this is not a problem, it just has to note
- # that the breakpoint condition is false and keep going.
+ # Get to the point where a signal is waiting to be delivered
+ gdb_test "next" "signal \[(\]+SIGUSR1"
+ gdb_test "next" "alarm \[(\]+"
+ gdb_test "next" "\[+\]+count"
+ # Give the signal time to get delivered
+ exec sleep 2
- gdb_test "p func1 ()" "^p func1 \[)(\]+\r\n.\[0-9\]* = void"
+ # Now call a function. When GDB tries to run the stack dummy,
+ # it will hit the breakpoint at handler. Provided it doesn't
+ # lose its cool, this is not a problem, it just has to note
+ # that the breakpoint condition is false and keep going.
- # Make sure the count got incremented.
+ gdb_test "p func1 ()" "^p func1 \[)(\]+\r\n.\[0-9\]* = void"
- # Haven't investigated this xfail
- setup_xfail "rs6000-*-*"
- gdb_test "p count" "= 2"
- if [istarget "rs6000-*-*"] { return 0 }
+ # Make sure the count got incremented.
- gdb_test "condition \\\$handler_breakpoint_number" "now unconditional"
- gdb_test "next" "alarm \[(\]+"
- gdb_test "next" "\[+\]+count"
- exec sleep 2
+ # Haven't investigated this xfail
+ setup_xfail "rs6000-*-*"
+ gdb_test "p count" "= 2"
+ if [istarget "rs6000-*-*"] { return 0 }
+
+ gdb_test "condition \$handler_breakpoint_number" "now unconditional"
+ gdb_test "next" "alarm \[(\]+"
+ gdb_test "next" "\[+\]+count"
+ exec sleep 2
- # This time we stop when GDB tries to run the stack dummy.
- # So it is OK that we do not print the return value from the function.
- gdb_test "p func1 ()" \
+ # This time we stop when GDB tries to run the stack dummy.
+ # So it is OK that we do not print the return value from the function.
+ gdb_test "p func1 ()" \
"Breakpoint \[0-9\]*, handler.*
The program being debugged stopped while in a function called from GDB"
- # But we should be able to backtrace...
- gdb_test "bt" "#0.*handler.*#1.*#2.*main"
- # ...and continue...
- gdb_test "continue" "Continuing"
- # ...and then count should have been incremented
- gdb_test "p count" "= 5"
- }
+ # But we should be able to backtrace...
+ gdb_test "bt" "#0.*handler.*#1.*#2.*main"
+ # ...and continue...
+ gdb_test "continue" "Continuing"
+ # ...and then count should have been incremented
+ gdb_test "p count" "= 5"
}
+
return 0