1 # Test Framework Driver for GDB driving a ROM monitor (via monitor.c).
2 # Copyright 1995 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
21 # gdb_version -- extract and print the version number of gdb
29 # Set gdb to target the monitor
31 proc gdb_target_monitor { } {
39 for {set i 1} {$i <= 3} {incr i} {
40 send "target $targetname $serialport\n"
42 -re "Remote target $targetname connected to.*$prompt $" {
43 verbose "Set target to $targetname"
46 -re "Connection refused" {
47 verbose "Connection refused by remote target. Pausing, and trying again."
52 perror "Couldn't set target for $targetname."
61 # gdb_load -- load a file into the debugger.
62 # return a -1 if anything goes wrong.
64 proc gdb_load { arg } {
71 if [gdb_file_cmd $arg] then { return -1 }
80 send_user "Loaded $arg into $GDB\n"
86 perror "GDB couldn't load."
91 perror "Timed out trying to load $arg."
98 # gdb_start -- start GDB running.
105 # gdb_exit -- exit gdb
108 catch default_gdb_exit