1 # Test Framework Driver
2 # Copyright (C) 1988, 1990, 1991, 1992 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
18 # Please email any bugs, comments, and/or additions to this file to:
21 # This file was written by Rob Savoye. (rob@cygnus.com)
23 # these need to be initialized only if site.exp doesn't set them
24 if ![info exists prompt] then {
29 # gdb_version -- extract and print the version number of gdb
35 set tmp [exec echo "q" | $GDB]
36 set version [lindex $tmp [lsearch $tmp "\[0-9\]*"]]
37 set version [string range $version 0 [expr [string length $version]-2]]
38 clone_output "[which $GDB] version $version $GDBFLAGS\n"
42 # gdb_load -- load a file into the debugger.
44 proc gdb_load { arg } {
50 set loadfile [file tail $arg]
51 set loadpath [file dirname $arg]
52 send_user "Not implememted yet\n" ; return -1
56 # gdb_exit -- exit the debugger
66 send_user "Got EOF from $GDB\n"
71 send_user "Got TIMEOUT from $GDB\n"
74 -re "The program is running. Quit anyway.*? (y or n) $"\
77 send_user "\t\tKilling program being debugged\n"
82 send_user "Quitting $GDB $GDBFLAGS\n"
87 # gdb_start -- start GDB running
96 send_user "Not implememted yet\n" ; return -1
100 "<return>" { send "\n"; clone_output "ERROR: Window too small" }
101 -re "\(y or n\) " { send "n\n"; clone_output "ERROR: Got interactive prompt" }
102 buffer_full { clone_output "ERROR: internal buffer is full" }
103 eof { clone_output "ERROR: eof -- pty is hosed" }
104 timeout { clone_output "ERROR: timeout" }
105 "virtual memory exhausted" { clone_output "ERROR: virtual memory exhausted" }
106 "Undefined command" { clone_output "ERROR: send string probably wrong" }
113 # make sure gdb has actually started, otherwise if the first test
114 # timesout, DejaGnu crashes