Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.server / abspath.exp
CommitLineData
25e3c82c
SDJ
1# This testcase is part of GDB, the GNU debugger.
2
88b9d363 3# Copyright 2018-2022 Free Software Foundation, Inc.
25e3c82c
SDJ
4
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18# Test that gdbserver performs path expansion/adjustment when we
19# provide just a filename (without any path specifications) to it.
20
21load_lib gdbserver-support.exp
22
23standard_testfile normal.c
24
25if { [skip_gdbserver_tests] } {
26 return 0
27}
28
29# Because we're relying on being able to change our CWD before
30# executing gdbserver, we just run if we're not testing with a remote
31# target.
32if { [is_remote target] } {
33 return 0
34}
35
8dc558a0
SM
36save_vars { GDBFLAGS } {
37 # If GDB and GDBserver are both running locally, set the sysroot to avoid
38 # reading files via the remote protocol (the `is_remote target` check is
39 # already done above).
40 if { ![is_remote host] } {
41 set GDBFLAGS "$GDBFLAGS -ex \"set sysroot\""
42 }
43
44 if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
45 return -1
46 }
25e3c82c
SDJ
47}
48
49# Make sure we're disconnected, in case we're testing with an
50# extended-remote board, therefore already connected.
51gdb_test "disconnect" ".*"
52
53set target_exec [gdbserver_download_current_prog]
54
55# Switch to where $target_exec lives, and execute gdbserver from
56# there.
57with_cwd "[file dirname $target_exec]" {
58 set target_execname [file tail $target_exec]
59 set res [gdbserver_start "" $target_execname]
60
61 set gdbserver_protocol [lindex $res 0]
62 set gdbserver_gdbport [lindex $res 1]
63 gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport
64
65 gdb_breakpoint main
66 gdb_test "continue" "Breakpoint $decimal.* main.*" "continue to main"
67}
This page took 0.478922 seconds and 4 git commands to generate.