1 # 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.
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.
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.
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.
19 # Please email any bugs, comments, and/or additions to this file to:
28 # Set gdb to the desired UDI target
30 proc gdb_target_udi { } {
35 set targetname [target_info mondfe,name];
36 # set targets hostname
37 send_gdb "target udi $targetname\n"
39 verbose "Timeout is now $timeout seconds" 2
41 -re "target udi $targetname\[\r\n\]+" {
44 -re "TIP UDI 1.2 Conformant.*$gdb_prompt $" {
45 verbose "Set target to $targetname"
47 -re "TIP-ipc WARNING,.*failed:" {
48 warning "$expect_out(buffer)"
50 -re "TIP-ipc ERROR,.*failed:" {
51 perror "$expect_out(buffer)"
53 -re "A program is being debugged already. Kill it\? \(y or n\)" {
58 perror "Couldn't set target for UDI."
64 verbose "Timeout is now $timeout seconds" 2
68 # gdb_load -- load a file into the debugger.
69 # return a -1 if anything goes wrong.
72 proc gdb_load { arg } {
79 if [gdb_file_cmd $arg] {
87 # gdb_start -- start GDB running. This assumes that there the
88 # UDICONF enviroment variable is set.
93 set env(UDICONF) [target_info mondfe,udi_soc];
95 verbose "Setting up target, Please wait..."
100 # gdb_exit -- exit gdb
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"