1 # Test Framework Driver for GDB driving Universal Debug Interface on 29K
2 # Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1997 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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)
27 # Set gdb to the desired UDI target
29 proc gdb_target_udi { } {
34 set targetname [target_info mondfe,name];
35 # set targets hostname
36 send_gdb "target udi $targetname\n"
38 verbose "Timeout is now $timeout seconds" 2
40 -re "target udi $targetname\[\r\n\]+" {
43 -re "TIP UDI 1.2 Conformant.*$gdb_prompt $" {
44 verbose "Set target to $targetname"
46 -re "TIP-ipc WARNING,.*failed:" {
47 warning "$expect_out(buffer)"
49 -re "TIP-ipc ERROR,.*failed:" {
50 perror "$expect_out(buffer)"
52 -re "A program is being debugged already. Kill it\? \(y or n\)" {
57 perror "Couldn't set target for UDI."
63 verbose "Timeout is now $timeout seconds" 2
67 # gdb_load -- load a file into the debugger.
68 # return a -1 if anything goes wrong.
71 proc gdb_load { arg } {
78 if [gdb_file_cmd $arg] {
86 # gdb_start -- start GDB running. This assumes that there the
87 # UDICONF enviroment variable is set.
92 set env(UDICONF) [target_info mondfe,udi_soc];
94 verbose "Setting up target, Please wait..."
99 # gdb_exit -- exit gdb
102 catch default_gdb_exit
103 set in [open [concat "|ls -F"] r]
104 while {[gets $in line]>-1} {
105 if [regexp "=$" $line] then {
106 set line [string trimright $line "="]
107 verbose "Removing the $line named socket"