]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.multi/base.exp
Adding files to HEAD that cvs had declared dead due to existing on
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.multi / base.exp
CommitLineData
b321dd90
PA
1# Copyright 2009 Free Software Foundation, Inc.
2
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.
7#
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.
12#
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/>.
15
16# Test multi-exec / multi-process features that work for all configurations,
17# even ones that cannot run multiple processes simultaneously.
18
19set testfile "base"
20
21set exec1 "hello"
22set srcfile1 ${exec1}.c
23set binfile1 ${objdir}/${subdir}/${exec1}
24
25set exec2 "hangout"
26set srcfile2 ${exec2}.c
27set binfile2 ${objdir}/${subdir}/${exec2}
28
29set exec3 "goodbye"
30set srcfile3 ${exec3}.c
31set binfile3 ${objdir}/${subdir}/${exec3}
32
33if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" {debug nowarnings}] } {
34 return -1
35}
36
37if { [prepare_for_testing ${testfile}.exp ${exec2} "${srcfile2}" {debug nowarnings}] } {
38 return -1
39}
40
41if { [prepare_for_testing ${testfile}.exp ${exec3} "${srcfile3}" {debug nowarnings}] } {
42 return -1
43}
44
45gdb_exit
46gdb_start
47gdb_reinitialize_dir $srcdir/$subdir
48gdb_load ${binfile1}
49
50# Add an empty inferior space, switch to it, and load a main
51# executable into it.
52gdb_test "add-inferior" "Added inferior 2.*"
53gdb_test "inferior 2" "Switching to inferior 2.*"
54gdb_test "file ${binfile2}" ""
55
56# Add a new inferior space and load a main executable into it in one
57# command.
58gdb_test "add-inferior -exec ${binfile3}"
59
60# Check that we have multiple spaces.
61
62gdb_test "info inferiors" \
63 "Executable.*${exec3}.*${exec2}.*${exec1}.*"
64
65# Test that we have multiple symbol tables.
66
67gdb_test "inferior 1"
68gdb_test "info functions commonfun" "${srcfile1}.*"
69
70gdb_test "inferior 3"
71gdb_test "info functions commonfun" "${srcfile3}.*"
72
73
74gdb_test "inferior 1"
75
76gdb_test "set listsize 1" ""
77
78gdb_test "list commonfun" "from hello.*"
79
80gdb_test "print hglob" "1"
81
82gdb_test "print glob" "92" "print glob (${exec1})"
83
84
85gdb_test "inferior 3"
86
87gdb_test "print gglob" "2"
88
89gdb_test "print glob" "45" "print glob (${exec3})"
90
91gdb_test "list commonfun" "from goodbye.*"
92
93
94# Let's run the hello program.
95gdb_test "inferior 1"
96
97if { ![runto_main] } then {
98 return -1
99}
100
101gdb_test "break hello" ""
102gdb_test "continue" "Breakpoint \[0-9\].*, hello.*"