public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/testsuite: respect GDBSERVER variable in remote-stdio-gdbserver "board"
@ 2021-12-08 12:03 Jan Vrany
  2021-12-09 17:56 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Vrany @ 2021-12-08 12:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jan Vrany

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.
---
 gdb/testsuite/boards/remote-stdio-gdbserver.exp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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 } {
-- 
2.30.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gdb/testsuite: respect GDBSERVER variable in remote-stdio-gdbserver "board"
  2021-12-08 12:03 [PATCH] gdb/testsuite: respect GDBSERVER variable in remote-stdio-gdbserver "board" Jan Vrany
@ 2021-12-09 17:56 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2021-12-09 17:56 UTC (permalink / raw)
  To: Jan Vrany via Gdb-patches; +Cc: Jan Vrany

>>>>> "Jan" == Jan Vrany via Gdb-patches <gdb-patches@sourceware.org> writes:

Jan> The comment on top of gdb/testsuite/boards/remote-stdio-gdbserver.exp says
Jan> that user can specify path to gdbserver on remote system by setting
Jan> GDBSERVER variable. However, this variable was ignored and /usr/bin/gdbserver
Jan> was used unconditionally.

Jan> This commit updates the code to respect GDBSERVER if set and fall back to
Jan> /usr/bin/gdbserver if not.

Thanks, this is ok.

I don't really understand why this board is written the way it is, but
at the same time, it seems to me that your patch is an improvement to
the current state.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-09 18:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 12:03 [PATCH] gdb/testsuite: respect GDBSERVER variable in remote-stdio-gdbserver "board" Jan Vrany
2021-12-09 17:56 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).