]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/jit-attach-pie.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / jit-attach-pie.exp
CommitLineData
1d506c26 1# Copyright (C) 2016-2024 Free Software Foundation, Inc.
bb805577
JK
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
06e93b05 16require can_spawn_for_attach
bb805577
JK
17
18standard_testfile .c
19set executable ${testfile}
20
21if { [build_executable ${testfile}.exp $executable $srcfile \
6ef69a3f 22 [list debug pthreads pie]] } {
bb805577
JK
23 return -1
24}
25
26# Start the program running and then wait for a bit, to be sure
27# that it can be attached to.
28
29set test_spawn_id [spawn_wait_for_attach $binfile]
30set testpid [spawn_id_get_pid $test_spawn_id]
31
32# gdb_load ("file" command) must not be executed for the bug reproducibility.
33# That includes prepare_for_testing or clean_restart.
34gdb_start
35
36set test "attach"
37gdb_test_multiple "attach $testpid" $test {
38 -re "Attaching to process $testpid\r\n.*Cannot insert breakpoint .*\r\n$gdb_prompt $" {
39 fail $test
40 }
41 -re "Attaching to process $testpid\r\n.*\r\n$gdb_prompt $" {
42 pass $test
43 }
44}
45
46kill_wait_spawned_process $test_spawn_id