old-cross-binutils/gdb/testsuite/config/nind-gdb.exp

119 lines
3.1 KiB
Text
Raw Normal View History

# Test Framework Driver
# Copyright (C) 1988, 1990, 1991, 1992 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# DejaGnu@cygnus.com
# This file was written by Rob Savoye. (rob@cygnus.com)
# these need to be initialized only if site.exp doesn't set them
if ![info exists prompt] then {
set prompt "\(gdb\)"
}
#
# gdb_version -- extract and print the version number of gdb
#
proc gdb_version {} {
global GDB
global GDBFLAGS
global prompt
set tmp [exec echo "q" | $GDB]
set version [lindex $tmp [lsearch $tmp "\[0-9\]*"]]
set version [string range $version 0 [expr [string length $version]-2]]
clone_output "[which $GDB] version $version $GDBFLAGS\n"
}
#
# gdb_load -- load a file into the debugger.
#
proc gdb_load { arg } {
global verbose
global loadpath
global loadfile
global prompt
global GDB
set loadfile [file tail $arg]
set loadpath [file dirname $arg]
send_user "Not implememted yet\n" ; alldone
}
#
# gdb_exit -- exit the debugger
#
proc gdb_exit {} {
global GDB
global GDBFLAGS
global verbose
send "quit\n"
expect {
eof {
if $verbose>1 then {
send_user "Got EOF from $GDB\n"
}
}
timeout {
if $verbose>1 then {
send_user "Got TIMEOUT from $GDB\n"
}
}
-re "The program is running. Quit anyway? (y or n) $"\
{ send "y\n"
if $verbose>1 then {
send_user "\t\tKilling program being debugged\n"
}
}
}
if $verbose>1 then {
send_user "Quitting $GDB $GDBFLAGS\n"
}
}
#
# gdb_start -- start GDB running
#
proc gdb_start { } {
global GDB
global GDBFLAGS
global spawn_id
global prompt
global verbose
global targetname
send_user "Not implememted yet\n" ; alldone
}
expect_after {
"<return>" { send "\n"; clone_output "ERROR: Window too small" }
-re "\(y or n\) " { send "n\n"; clone_output "ERROR: Got interactive prompt" }
buffer_full { clone_output "ERROR: internal buffer is full" }
eof { clone_output "ERROR: eof -- pty is hosed" }
timeout { clone_output "ERROR: timeout" }
"virtual memory exhausted" { clone_output "ERROR: virtual memory exhausted" }
"Undefined command" { clone_output "ERROR: send string probably wrong" }
}
load_lib gdb.exp
gdb_start
# make sure gdb has actually started, otherwise if the first test
# timesout, DejaGnu crashes
send "\n"
expect {
-re "$prompt"
}