1 # Test Framework Driver for GDB driving a builtin simulator
2 # Copyright 1994 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. */
20 # The SH simulator by default will allocate 16M of memory, which is
21 # convenient, but it slows down testing to chew up that much swap;
22 # so supply an option that makes the simulator allocate 256K.
24 set target_sim_options ""
26 if [istarget "sh*-*-*"] then {
27 set target_sim_options "18"
32 # Set gdb to target the simulator
34 proc gdb_target_sim { } {
38 global target_sim_options
41 set spawn_id $gdb_spawn_id
42 send_gdb "target sim $target_sim_options\n"
44 verbose "Timeout is now $timeout seconds" 2
46 -re "Connected to the simulator.*$prompt $" {
47 verbose "Set target to sim"
50 perror "Couldn't set target for simulator."
56 verbose "Timeout is now $timeout seconds" 2
60 # gdb_load -- load a file into the debugger.
61 # return a -1 if anything goes wrong.
63 proc gdb_load { arg } {
71 set spawn_id $gdb_spawn_id
73 if [gdb_file_cmd $arg] then { return -1 }
79 verbose "Timeout is now $timeout seconds" 2
83 send_user "Loaded $arg into $GDB\n"
86 verbose "Timeout is now $timeout seconds" 2
91 perror "GDB couldn't load."
96 perror "Timed out trying to load $arg."