From: Jan Vrany Date: Fri, 10 Dec 2021 11:43:20 +0000 (+0000) Subject: gdb/testsuite: respect GDBSERVER variable in remote-stdio-gdbserver "board" X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=43f7c3581f5c615b65f7c15c298c9be20c2597cf;p=binutils-gdb.git gdb/testsuite: respect GDBSERVER variable in remote-stdio-gdbserver "board" The comment on top of gdb/testsuite/boards/remote-stdio-gdbserver.exp says that user can specify path to gdbserver on remote system by setting GDBSERVER variable. However, this variable was ignored and /usr/bin/gdbserver was used unconditionally. This commit updates the code to respect GDBSERVER if set and fall back to /usr/bin/gdbserver if not. --- diff --git a/gdb/testsuite/boards/remote-stdio-gdbserver.exp b/gdb/testsuite/boards/remote-stdio-gdbserver.exp index 79a0e9803d7..9fc4e2d5ce5 100644 --- a/gdb/testsuite/boards/remote-stdio-gdbserver.exp +++ b/gdb/testsuite/boards/remote-stdio-gdbserver.exp @@ -56,6 +56,13 @@ if [info exists REMOTE_TMPDIR] { set_board_info remotedir $REMOTE_TMPDIR } +unset_board_info gdb_server_prog +if [info exists GDBSERVER] { + set_board_info gdb_server_prog $GDBSERVER +} else { + set_board_info gdb_server_prog /usr/bin/gdbserver +} + proc get_remote_login { } { set result "" if {[board_info [target_info name] exists username]} { @@ -70,7 +77,8 @@ proc get_remote_login { } { proc get_target_remote_pipe_cmd { } { set target_exec [gdbserver_download_current_prog] set rsh_cmd "[board_info [target_info name] rsh_prog] [get_remote_login]" - return "$rsh_cmd /usr/bin/gdbserver --once stdio $target_exec" + set gdbserver "[board_info [target_info name] gdb_server_prog]" + return "$rsh_cmd $gdbserver --once stdio $target_exec" } proc ${board}_file { dest op args } {