diff options
author | Stan Shebs <shebs@codesourcery.com> | 1994-06-08 19:25:43 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 1994-06-08 19:25:43 +0000 |
commit | 0fba9aa255008780fa0638908dd683122186b502 (patch) | |
tree | 59adc0b45f5295537d6d43d780baacf5c01ae20b /gdb/testsuite/lib | |
parent | 0b3d0999e96c8ccc0c552dfee27be3d48d811f12 (diff) | |
download | gdb-0fba9aa255008780fa0638908dd683122186b502.zip gdb-0fba9aa255008780fa0638908dd683122186b502.tar.gz gdb-0fba9aa255008780fa0638908dd683122186b502.tar.bz2 |
Wed Jun 8 12:12:17 1994 Stan Shebs (shebs@andros.cygnus.com)
* config/udi-gdb.exp, config/unix-gdb.exp: Call default_gdb_start.
* lib/gdb.exp (default_gdb_start): Define.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 69 |
1 files changed, 67 insertions, 2 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 35ac4e1..9e42606 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1992 Free Software Foundation, Inc. +# Copyright (C) 1992, 1994 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 @@ -25,7 +25,7 @@ global GDB if ![info exists GDB] then { - set GDB [transform gdb] + set GDB [findfile $base_dir/../gdb "gdb" [transform gdb ]] } global GDBFLAGS @@ -396,6 +396,71 @@ oaded." } # +# start gdb -- start gdb running, default procedure +# +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 "Seting 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 # gdb tests suite. |