1 # This testcase is part of GDB, the GNU debugger.
3 # Copyright 2018-2019 Free Software Foundation, Inc.
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.
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.
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/>.
18 # Test that gdbserver performs path expansion/adjustment when we
19 # provide just a filename (without any path specifications) to it.
21 load_lib gdbserver-support.exp
23 standard_testfile normal.c
25 if { [skip_gdbserver_tests] } {
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
32 if { [is_remote target] } {
36 if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
40 # Make sure we're disconnected, in case we're testing with an
41 # extended-remote board, therefore already connected.
42 gdb_test "disconnect" ".*"
44 set target_exec [gdbserver_download_current_prog]
46 # Switch to where $target_exec lives, and execute gdbserver from
48 with_cwd "[file dirname $target_exec]" {
49 set target_execname [file tail $target_exec]
50 set res [gdbserver_start "" $target_execname]
52 set gdbserver_protocol [lindex $res 0]
53 set gdbserver_gdbport [lindex $res 1]
54 gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport
57 gdb_test "continue" "Breakpoint $decimal.* main.*" "continue to main"