OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [testsuite/] [config/] [vx.exp] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 106 markom
#   Copyright (C) 1988, 1990, 1991, 1992, 1995, 1997 Free Software Foundation, Inc.
2
 
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
 
17
# Please email any bugs, comments, and/or additions to this file to:
18
# DejaGnu@cygnus.com
19
 
20
# This file was written by Rob Savoye. (rob@cygnus.com)
21
 
22
#
23
# load support libraries
24
#
25
load_lib remote.exp
26
load_lib gdb.exp
27
 
28
set shell_prompt "->"
29
set gdb_prompt "\\(vxgdb\\)"
30
 
31
#
32
# gdb_version -- extract and print the version number of gcc
33
#
34
proc gdb_version {} {
35
    default_gdb_version
36
}
37
 
38
#
39
# gdb_load -- load a file into the debugger.
40
# We have to stop and start gdb each time we do this, because when
41
# vxgdb loads two files in a row, the symbols in the first file loaded
42
# take precedence. Returns -1 on error, else 0.
43
#
44
proc gdb_load { arg } {
45
    set result 0
46
 
47
    if { [remote_ld target $arg] != 0 } {
48
        perror "Couldn't load $arg"
49
        return -1
50
    }
51
 
52
    return [gdb_file_cmd $arg]
53
}
54
 
55
#
56
# gdb_start -- start gdb running
57
#
58
proc gdb_start { } {
59
    global gdb_prompt
60
    global verbose
61
    global connectmode
62
    global reboot
63
 
64
    # get a connection to the board
65
    for { set x 0; } { $x < 3 } { incr x } {
66
        set shell_id [remote_open target]
67
        if { $shell_id > 0 } {
68
            verbose "Spawn id for remote shell is $shell_id"
69
 
70
            set timeout 10
71
            verbose "Timeout is now $timeout seconds" 2
72
 
73
            set state [spawn_vxgdb];
74
            if { $state == "pass" } {
75
                return 0;
76
            }
77
            if { $state == "fail" } {
78
                return -1;
79
            }
80
        }
81
        remote_reboot target;
82
    }
83
}
84
 
85
proc spawn_vxgdb { } {
86
    global gdb_prompt
87
 
88
    default_gdb_start
89
 
90
    # set the default arguments to "main", so that "run" with no
91
    # arguments will work correctly.
92
    send_gdb "set args main\n"
93
    gdb_expect -re ".*$gdb_prompt $" {}
94
 
95
    verbose "Setting up target, Please wait..."
96
    # set targets hostname
97
    send_gdb "target vxworks [target_info hostname]\n"
98
    set timeout 60
99
    verbose "Timeout is now $timeout seconds" 2
100
    gdb_expect {
101
        -re "Done\..*$gdb_prompt $"     {
102
            verbose "Set target to [target_info hostname]" 1
103
            set timeout 10;
104
            return "pass";
105
        }
106
        -re "net_connect: RPC: (Program not registered|.*Timed out).*$" {
107
            warning "Couldn't set GDB to target [target_info netport]."
108
        }
109
        timeout {
110
            warning "Couldn't set target for vxworks."
111
        }
112
    }
113
    return "retry";
114
}
115
 
116
proc gdb_exit { } {
117
    remote_close target;
118
    catch default_gdb_exit
119
}
120
 
121
#expect_after {
122
#    ""            { send "\n"; perror "Window too small." }
123
#    -re "\(y or n\) "     { send "n\n"; perror "Got interactive prompt." }
124
#    buffer_full                   { perror "internal buffer is full." }
125
#    eof                           { perror "eof -- pty is hosed." }
126
#    timeout                       { perror "timeout." }
127
#    "virtual memory exhausted" { perror "virtual memory exhausted." }
128
#    "Undefined command"           { perror "send string probably wrong." }
129
#}
130
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.