1 # Copyright 2009 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 # Test multi-exec / multi-process features that work for all configurations,
17 # even ones that cannot run multiple processes simultaneously.
22 set srcfile1 ${exec1}.c
23 set binfile1 ${objdir}/${subdir}/${exec1}
26 set srcfile2 ${exec2}.c
27 set binfile2 ${objdir}/${subdir}/${exec2}
30 set srcfile3 ${exec3}.c
31 set binfile3 ${objdir}/${subdir}/${exec3}
33 if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" {debug nowarnings}] } {
37 if { [prepare_for_testing ${testfile}.exp ${exec2} "${srcfile2}" {debug nowarnings}] } {
41 if { [prepare_for_testing ${testfile}.exp ${exec3} "${srcfile3}" {debug nowarnings}] } {
47 gdb_reinitialize_dir $srcdir/$subdir
50 # Add an empty inferior space, switch to it, and load a main
52 gdb_test "add-inferior" "Added inferior 2.*"
53 gdb_test "inferior 2" "Switching to inferior 2.*"
54 gdb_test "file ${binfile2}" ""
56 # Add a new inferior space and load a main executable into it in one
58 gdb_test "add-inferior -exec ${binfile3}"
60 # Check that we have multiple spaces.
62 gdb_test "info inferiors" \
63 "Executable.*${exec3}.*${exec2}.*${exec1}.*"
65 # Test that we have multiple symbol tables.
68 gdb_test "info functions commonfun" "${srcfile1}.*"
71 gdb_test "info functions commonfun" "${srcfile3}.*"
76 gdb_test "set listsize 1" ""
78 gdb_test "list commonfun" "from hello.*"
80 gdb_test "print hglob" "1"
82 gdb_test "print glob" "92" "print glob (${exec1})"
87 gdb_test "print gglob" "2"
89 gdb_test "print glob" "45" "print glob (${exec3})"
91 gdb_test "list commonfun" "from goodbye.*"
94 # Let's run the hello program.
97 if { ![runto_main] } then {
101 gdb_test "break hello" ""
102 gdb_test "continue" "Breakpoint \[0-9\].*, hello.*"