diff --git a/gdb/remote.c b/gdb/remote.c index 5535afbc100..e1b54c6f9af 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1890,7 +1890,12 @@ static void show_remote_exec_file (struct ui_file *file, int from_tty, struct cmd_list_element *cmd, const char *value) { - gdb_printf (file, "%s\n", get_remote_exec_file ().c_str ()); + const std::string &filename = get_remote_exec_file (); + if (filename.empty ()) + gdb_printf (file, _("The remote exec-file is unset, the default remote " + "executable will be used.\n")); + else + gdb_printf (file, "The remote exec-file is \"%s\".\n", filename.c_str ()); } static int @@ -16654,8 +16659,12 @@ Transfer files to and from the remote target system."), add_setshow_string_noescape_cmd ("exec-file", class_files, _("\ -Set the remote pathname for \"run\"."), _("\ -Show the remote pathname for \"run\"."), NULL, +Set the remote file name for starting inferiors."), _("\ +Show the remote file name for starting inferiors."), _("\ +This is the file name, on the remote target, used when starting an\n\ +inferior, for example with the \"run\", \"start\", or \"starti\"\n\ +commands. This setting is only useful when debugging a remote target,\n\ +otherwise, this setting is not used."), set_remote_exec_file_cb, get_remote_exec_file, show_remote_exec_file, diff --git a/gdb/testsuite/gdb.base/remote-exec-file.exp b/gdb/testsuite/gdb.base/remote-exec-file.exp index b73528114c4..baaf03952e6 100644 --- a/gdb/testsuite/gdb.base/remote-exec-file.exp +++ b/gdb/testsuite/gdb.base/remote-exec-file.exp @@ -37,10 +37,13 @@ with_test_prefix "set inf 2" { with_test_prefix "show inf 1" { gdb_test "inferior 1" "Switching to inferior 1.*" - gdb_test "show remote exec-file" "prog1" + gdb_test "show remote exec-file" \ + "The remote exec-file is \"prog1\"\\." + } with_test_prefix "show inf 2" { gdb_test "inferior 2" "Switching to inferior 2.*" - gdb_test "show remote exec-file" "prog2" + gdb_test "show remote exec-file" \ + "The remote exec-file is \"prog2\"\\." } diff --git a/gdb/testsuite/gdb.multi/gdb-settings.exp b/gdb/testsuite/gdb.multi/gdb-settings.exp index 026a10ba68a..97961f5b933 100644 --- a/gdb/testsuite/gdb.multi/gdb-settings.exp +++ b/gdb/testsuite/gdb.multi/gdb-settings.exp @@ -90,7 +90,7 @@ foreach_with_prefix inf $inferiors { gdb_test "show inferior-tty" "/inf${inf}-tty.*" gdb_test "with remote exec-file tmp-value -- print 1" " = 1" - gdb_test "show remote exec-file" "/inf${inf}-remote-exec" + gdb_test "show remote exec-file" "/inf${inf}-remote-exec.*" # If the inferiors are running check $_gdb_setting_str and # $_gdb_setting return the correct values.