1 # Test Framework Driver for GDB driving a builtin simulator
2 # Copyright 1994, 1997, 1998, 2004, 2007, 2008
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 3 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, see <http://www.gnu.org/licenses/>.
22 # Set gdb to target the simulator
24 proc gdb_target_sim { } {
27 set target_sim_options "[board_info target gdb,target_sim_options]";
29 send_gdb "target sim $target_sim_options\n"
31 verbose "Timeout is now $timeout seconds" 2
33 -re "Connected to the simulator.*$gdb_prompt $" {
34 verbose "Set target to sim"
37 perror "Couldn't set target for simulator."
43 verbose "Timeout is now $timeout seconds" 2
48 # gdb_load -- load a file into the debugger.
49 # return a -1 if anything goes wrong.
51 proc gdb_load { arg } {
59 if [gdb_file_cmd $arg] then { return -1 }
62 if [gdb_target_sim] then { return -1 }
66 verbose "Timeout is now $timeout seconds" 2
68 -re ".*$gdb_prompt $" {
70 send_user "Loaded $arg into $GDB\n"
73 verbose "Timeout is now $timeout seconds" 2
78 perror "GDB couldn't load."
83 perror "Timed out trying to load $arg."