1 # Copyright
2005 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
2 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
, write to the Free Software
15 # Foundation
, Inc.
, 59 Temple Place
- Suite
330, Boston
, MA
02111-1307, USA.
23 set testdir
"exec_changed"
24 file
mkdir $
{objdir
}/$
{subdir
}/$
{testdir
}
26 # Build the first test
program (note that cygwin needs the $EXEEXT
).
27 set testfile1
"${testdir}/first"
28 set srcfile1 $
{srcdir
}/$
{subdir
}/$
{testfile1
}.adb
29 set binfile1 $
{objdir
}/$
{subdir
}/$
{testfile1
}$EXEEXT
31 if {[gdb_compile_ada
"${srcfile1}" "${binfile1}" executable [list debug ]] != "" } {
35 # Build the second test
program
36 set testfile2
"${testdir}/second"
37 set srcfile2 $
{srcdir
}/$
{subdir
}/$
{testfile2
}.adb
38 set binfile2 $
{objdir
}/$
{subdir
}/$
{testfile2
}$EXEEXT
40 if {[gdb_compile_ada
"${srcfile2}" "${binfile2}" executable [list debug ]] != "" } {
44 # Start with a fresh gdb.
46 set testfile
"${testdir}/common"
47 set binfile $
{objdir
}/$
{subdir
}/$
{testfile
}$EXEEXT
50 gdb_reinitialize_dir $srcdir
/$subdir
52 #
Load the first executable.
54 gdb_test
"shell mv ${binfile1} ${binfile}" "" ""
57 # Start the
program, we should land in the
program main procedure
59 "first \\(\\) at .*first.adb.*" \
62 # Restore first executable to its original
name, and
move
63 # second executable into its place. Ensure that the new
64 # executable is at least a second newer than the old.
66 gdb_test
"shell mv ${binfile} ${binfile1}" "" ""
67 gdb_test
"shell mv ${binfile2} ${binfile}" "" ""
68 gdb_test
"shell sleep 1" "" ""
69 gdb_test
"shell touch ${binfile}" "" ""
71 # Stop GDB from asking confirmations. This test will restart the
program
72 # and we don
't need GDB to ask us to confirm that we want to kill the
74 gdb_test "set confirm off" "" ""
76 # Start the program a second time, GDB should land in procedure Second
79 if [is_remote target] {
80 unsupported "start the program a second time ";
82 # Start the program, we should land in the program main procedure
84 "second \\(\\) at .*second.adb.*" \