aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
authorBill Cox <bill@cygnus>1994-05-19 19:58:04 +0000
committerBill Cox <bill@cygnus>1994-05-19 19:58:04 +0000
commit2f1099839992840fbf5c913c7e56d98d750a3398 (patch)
treece7ff493109426fe8bb3a14a5c398679cc062ef9 /gdb/testsuite/lib
parentf9c57637e42d17078adb2b1cb544d43426cda697 (diff)
downloadgdb-2f1099839992840fbf5c913c7e56d98d750a3398.zip
gdb-2f1099839992840fbf5c913c7e56d98d750a3398.tar.gz
gdb-2f1099839992840fbf5c913c7e56d98d750a3398.tar.bz2
* Makefile.in, configure.in, config/mips-gdb.exp,
config/mt-a29k-udi, config/mt-i386-aout, config/mt-i960-nindy, config/mt-sparc-aout, config/udi-gdb.exp, config/unix-gdb.exp, config/unknown.exp, gdb.t00/default.exp, gdb.t00/help.exp,, gdb.t00/teststrategy.exp, gdb.t01/Makefile.in, gdb.t02/Makefile.in, gdb.t02/whatis.exp, gdb.t03/Makefile.in, gdb.t03/gdbme.c, gdb.t04/Makefile.in, gdb.t05/Makefile.in, gdb.t06/Makefile.in, gdb.t06/break.exp, gdb.t06/signals.c, gdb.t06/signals.exp, gdb.t08/Makefile.in, gdb.t08/opaque.exp, gdb.t09/Makefile.in, gdb.t10/Makefile.in, gdb.t11/Makefile.in, gdb.t12/Makefile.in, gdb.t13/Makefile.in, gdb.t15/Makefile.in, gdb.t15/funcargs.exp, gdb.t15/gdbme.c, gdb.t15/return.exp, gdb.t16/Makefile.in, gdb.t17/Makefile.in, gdb.t17/callfuncs.exp, gdb.t17/gdbme.c, gdb.t20/Makefile.in, gdb.t21/Makefile.in, gdb.t21/cplusfuncs.exp, gdb.t22/Makefile.in, gdb.t22/virtfunc.exp, gdb.t23/Makefile.in, gdb.t24/demangle.exp, lib/gdb.exp: Check in Rob's testing changes from 94Q1.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/gdb.exp93
1 files changed, 80 insertions, 13 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index cf754f9..38cc31c 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -19,13 +19,19 @@
# This file was written by Fred Fish. (fnf@cygnus.com)
+# set the prompt if it doesn't exist
+global prompt
+if ![info exists prompt] then {
+ set prompt "\[(\]gdb\[)\]"
+}
+
# Generic gdb subroutines that should work for any target. If these
# need to be modified for any target, it can be done with a variable
# or by passing arguments.
global GDB
if ![info exists GDB] then {
- set GDB [transform gdb]
+ set GDB [findfile $base_dir/../gdb "gdb" [transform gdb ]]
}
global GDBFLAGS
@@ -33,12 +39,6 @@ if ![info exists GDBFLAGS] then {
set GDBFLAGS ""
}
-# set the prompt if it doesn't exist
-global prompt
-if ![info exists prompt] then {
- set prompt "\[(\]gdb\[)\]"
-}
-
#
# gdb_version -- extract and print the version number of gcc
#
@@ -301,12 +301,13 @@ proc default_gdb_exit {} {
# This used to be 1 for unix-gdb.exp
set timeout 5
- # We used to try to send "quit" to GDB, and wait for it to die.
- # Dealing with all the cases and errors got pretty hairy. Just close it,
- # that is simpler.
- close
-
- # Omitting this probably would cause strange timing-dependent failures.
+ # this will kill the gdb process, it's cleaner than sending a quit.
+ close
+
+ # Before this was here sometimes "uit" would get sent to the next GDB
+ # (assuming this is immediately followed by gdb_start), which would
+ # cause a loss of syncronization (i.e. all the stuff that swallows a
+ # prompt would swallow the wrong one).
wait
}
@@ -373,6 +374,72 @@ oaded."
}
}
+
+#
+# start gdb -- start gdb running
+#
+proc default_gdb_start { } {
+ global verbose
+ global GDB
+ global GDBFLAGS
+ global prompt
+ global spawn_id
+ global timeout
+ verbose "Spawning $GDB $GDBFLAGS"
+
+ set oldtimeout $timeout
+ set timeout [expr "$timeout + 60"]
+ if [ llength $GDBFLAGS ] then {
+ if {[which $GDB] != 0} then {
+ spawn $GDB $GDBFLAGS
+ } else {
+ perror "$GDB does not exist."
+ exit 1
+ }
+ } else {
+ if {[which $GDB] != 0} then {
+ spawn $GDB
+ } else {
+ perror "$GDB does not exist."
+ exit 1
+ }
+ }
+ expect {
+ -re ".*\r\n$prompt $" {
+ verbose "GDB initialized for native mode"
+ }
+ -re "$prompt $" {
+ perror "GDB never initialized."
+ return -1
+ }
+ timeout {
+ perror "(timeout) GDB never initialized."
+ return -1
+ }
+ }
+ set timeout $oldtimeout
+ # force the height to "unlimited", so no pagers get used
+ send "set height 0\n"
+ expect {
+ -re ".*$prompt $" {
+ verbose "Setting height to 0." 2
+ }
+ timeout {
+ warning "Couldn't set the height to 0."
+ }
+ }
+ # force the width to "unlimited", so no wraparound occurs
+ send "set width 0\n"
+ expect {
+ -re ".*$prompt $" {
+ verbose "Setting width to 0." 2
+ }
+ timeout {
+ warning "Couldn't set the width to 0."
+ }
+ }
+}
+
#
# FIXME: this is a copy of the new library procedure, but it's here too
# till the new dejagnu gets installed everywhere. I'd hate to break the