aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/config/nind-gdb.exp
blob: c015f5d44977facbf3e7c8ef2a30870c8a3cf447 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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" ; return -1
}

#
# 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" ; return -1
}

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"
    }