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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21 # gdb_version -- extract and print the version number of gdb
29 # Set gdb to target the monitor
31 proc gdb_target_monitor { } {
40 if {$baud != ""} then {
41 send "set remotebaud $baud\n"
43 if [info exists target_info(target,cflags)] {
44 set targetname "$target_info(target,target)"
46 if [info exists target_info(target,netport)] {
47 set serialport "$target_info(target,netport)"
49 for {set i 1} {$i <= 3} {incr i} {
50 send "target $targetname $serialport\n"
52 -re "Remote target $targetname connected to.*$prompt $" {
53 verbose "Set target to $targetname"
56 -re "Connection refused" {
57 verbose "Connection refused by remote target. Pausing, and trying again."
67 perror "Couldn't set target for $targetname."
73 # gdb_load -- load a file into the debugger.
74 # return a -1 if anything goes wrong.
76 proc gdb_load { arg } {
83 if [gdb_file_cmd $arg] then { return -1 }
87 verbose "Loading $arg"
93 send_user "Loaded $arg into $GDB\n"
99 perror "GDB couldn't load."
103 if { $verbose > 1 } {
104 perror "Timed out trying to load $arg."
111 # gdb_start -- start GDB running.
118 # gdb_exit -- exit gdb
121 catch default_gdb_exit