]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.multi/multi-arch-exec.exp
Update years in copyright notice for the GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.multi / multi-arch-exec.exp
CommitLineData
8acc9f48 1# Copyright 2009-2013 Free Software Foundation, Inc.
9107fc8d
PA
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 "multi-arch-exec"
20
21# The plain remote target can't do multiple inferiors.
22if [target_info exists use_gdb_stub] {
23 return
e780d813
DE
24}
25
26# The 64-bit compile may succeed for i386-linux, but gdb won't be able
27# to load the file.
28if [istarget "i?86-*linux*"] {
29 return
9107fc8d
PA
30}
31
32# Can't use standard_testfile, we want executables with specialized
33# names.
34set exec1 "multi-arch-exec"
35set srcfile1 multi-arch-exec.c
36set binfile1 [standard_output_file ${exec1}]
37
38set exec2 "multi-arch-exec-hello"
39set srcfile2 hello.c
40set binfile2 [standard_output_file ${exec2}]
41
42# Build two executables, one for each arch.
43
44if [istarget "s390*-*-*"] {
45 set march1 "-m64"
46 set march2 "-m31"
47} else {
48 set march1 "-m64"
49 set march2 "-m32"
50}
51
52if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" \
53 [list debug nowarnings additional_flags=${march1}]] } {
54 return -1
55}
56
57if { [prepare_for_testing ${testfile}.exp ${exec2} "${srcfile2}" \
58 [list debug nowarnings additional_flags=${march2}]] } {
59 return -1
60}
61
62clean_restart ${exec1}
63if ![runto_main] then {
64 fail "Couldn't run to main"
65 return -1
66}
67
68# Test that GDB updates the target description / arch successfuly
69# after the exec.
70gdb_test "continue" "Breakpoint 1, main.*" "continue across exec that changes architecture"