Update copyright year range in header of all files managed by GDB
[binutils-gdb.git] / gdb / testsuite / gdb.base / symlink-sourcefile.exp
blobfad5da960aa7e865fd31a2d3453364c1eafbebef
1 # Copyright 2019-2023 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 that GDB can find the default symtab when it is a symbolic link.
17 standard_testfile
19 set test "file symbolic link name"
20 set linksrc "link-${srcfile}"
21 set srcfilelink [standard_output_file $linksrc]
24 # Remove any existing symlink and build executable using a
25 # symbolic link to the actual source file.
26 remote_file host delete $srcfilelink
27 set status [remote_exec host \
28                 "ln -sf $srcdir/$subdir/$srcfile $srcfilelink"]
29 if {[lindex $status 0] != 0} {
30     unsupported "$test (host does not support symbolic links)"
31     return 0
34 if {[prepare_for_testing $testfile $testfile $srcfilelink]} {
35     return -1
38 if {![runto_main]} {
39     return -1
42 # Using a line number ensures that the default symtab is used.
43 gdb_breakpoint [gdb_get_line_number "break here" $srcfile] message
44 gdb_continue_to_breakpoint "run to breakpoint marker"