]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/symlink-sourcefile.exp
Automatic Copyright Year update after running gdb/copyright.py
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / symlink-sourcefile.exp
CommitLineData
4a94e368 1# Copyright 2019-2022 Free Software Foundation, Inc.
bb995d00
KS
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 that GDB can find the default symtab when it is a symbolic link.
17standard_testfile
18
19set test "file symbolic link name"
20set linksrc "link-${srcfile}"
21set srcfilelink [standard_output_file $linksrc]
22
23
24# Remove any existing symlink and build executable using a
25# symbolic link to the actual source file.
26remote_file host delete $srcfilelink
27set status [remote_exec host \
28 "ln -sf $srcdir/$subdir/$srcfile $srcfilelink"]
29if {[lindex $status 0] != 0} {
30 unsupported "$test (host does not support symbolic links)"
31 return 0
32}
33
34if {[prepare_for_testing $testfile $testfile $srcfilelink]} {
35 return -1
36}
37
38if {![runto_main]} {
bb995d00
KS
39 return -1
40}
41
42# Using a line number ensures that the default symtab is used.
43gdb_breakpoint [gdb_get_line_number "break here" $srcfile] message
44gdb_continue_to_breakpoint "run to breakpoint marker"