Add option for testing dejagnu auxiliary launcher with specified shell
[dejagnu.git] / baseboards / basic-sim.exp
blobc561f1bcd5d81723033c4006f62bf67ea87b3af1
1 # Copyright (C) 1997-2016 Free Software Foundation, Inc.
3 # This file is part of DejaGnu.
5 # DejaGnu is free software: you can redistribute it and/or modify it
6 # 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 # DejaGnu is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with DejaGnu. If not, see <http://www.gnu.org/licenses/>.
18 # find_sim -- find a usable simulator
19 # This proc is local to this file and is used to locate a simulator to use.
20 # First we see if SIM=foo was specified on the command line.
21 # Otherwise we search the build tree, then $PATH.
23 proc find_sim { target_alias sim_dir sim_name } {
24 global tool_root_dir
25 global SIM
27 if {[info exists SIM]} {
28 return $SIM
31 if {[isremote host]} {
32 if {![board_info host exists no_transform_name]} {
33 return $target_alias-$sim_name
34 } else {
35 return $sim_name
39 # We have to search because tool_root_dir may actually point to that blasted
40 # "target" subdirectory.
41 set try [lookfor_file $tool_root_dir sim/$sim_dir/$sim_name]
42 if { $try ne "" } {
43 return $try
45 return $target_alias-$sim_name
48 proc setup_sim { subdir_name } {
49 global target_alias
50 global tool_root_dir
51 global board
53 if {[info exists target_alias]} {
54 set tmp $target_alias
55 } else {
56 if {[board_info $board exists target_install]} {
57 set tmp [lindex [board_info $board target_install] 0]
61 if {![board_info $board exists sim]} {
62 set_board_info sim [find_sim $tmp $subdir_name run]
65 verbose "Using simulator [board_info $board sim]\n"
68 set_board_info is_simulator 1
70 # Most simulators need the image reloaded and reinitialized to rerun.
71 set_board_info gdb,do_reload_on_run 1