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

Subversion Repositories or1k

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Test Framework Driver for GDB driving Universal Debug Interface on 29K
2
#   Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1997
3
#   Free Software Foundation, Inc.
4
#
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
9
#
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
 
19
# Please email any bugs, comments, and/or additions to this file to:
20
# DejaGnu@cygnus.com
21
 
22
# This file was written by Rob Savoye. (rob@cygnus.com)
23
 
24
load_lib gdb.exp
25
 
26
#
27
# gdb_target_udi
28
# Set gdb to the desired UDI target
29
#
30
proc gdb_target_udi { } {
31
    global gdb_prompt
32
    global verbose
33
    global exit_status
34
 
35
    set targetname [target_info mondfe,name];
36
    # set targets hostname
37
    send_gdb "target udi $targetname\n"
38
    set timeout 60
39
    verbose "Timeout is now $timeout seconds" 2
40
    gdb_expect {
41
        -re "target udi $targetname\[\r\n\]+" {
42
            exp_continue
43
        }
44
        -re "TIP UDI 1.2 Conformant.*$gdb_prompt $"     {
45
            verbose "Set target to $targetname"
46
        }
47
        -re "TIP-ipc WARNING,.*failed:" {
48
            warning "$expect_out(buffer)"
49
        }
50
        -re "TIP-ipc ERROR,.*failed:" {
51
            perror "$expect_out(buffer)"
52
        }
53
        -re "A program is being debugged already.  Kill it\? \(y or n\)" {
54
            send "y\n"
55
            exp_continue
56
        }
57
        timeout {
58
            perror "Couldn't set target for UDI."
59
            cleanup
60
            exit $exit_status
61
        }
62
    }
63
    set timeout 10
64
    verbose "Timeout is now $timeout seconds" 2
65
}
66
 
67
#
68
# gdb_load -- load a file into the debugger.
69
#             return a -1 if anything goes wrong.
70
#
71
 
72
proc gdb_load { arg } {
73
    global verbose
74
    global loadpath
75
    global loadfile
76
    global GDB
77
    global gdb_prompt
78
 
79
    if [gdb_file_cmd $arg] {
80
        return -1
81
    }
82
 
83
    gdb_target_udi
84
}
85
 
86
#
87
# gdb_start -- start GDB running. This assumes that there the
88
#              UDICONF enviroment variable is set.
89
#
90
proc gdb_start { } {
91
    global env;
92
 
93
    set env(UDICONF) [target_info mondfe,udi_soc];
94
    default_gdb_start
95
    verbose "Setting up target, Please wait..."
96
    gdb_target_udi
97
}
98
 
99
#
100
# gdb_exit -- exit gdb
101
#
102
proc gdb_exit { } {
103
    catch default_gdb_exit
104
    set in [open [concat "|ls -F"] r]
105
    while {[gets $in line]>-1} {
106
        if [regexp "=$" $line] then {
107
            set line [string trimright $line "="]
108
            verbose "Removing the $line named socket"
109
            exec rm -f $line
110
        }
111
    }
112
    close $in
113
}

powered by: WebSVN 2.1.0

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