[01/10] gdb: have remote_target::extended_remote_run take the exec filename

Message ID 6c1b1e9fa07b4bb4842e9ee7385d33ada3af6c9d.1692200989.git.aburgess@redhat.com
State New
Headers
Series Improve GDB/gdbserver experience when using a local gdbserver |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Patch failed to apply

Commit Message

Andrew Burgess Aug. 16, 2023, 3:54 p.m. UTC
  Small refactor, have remote_target::extended_remote_run take the name
of the executable to run rather than looking it up directly, the one
caller of this function has already looked up the remote-exec
filename.

There should be no user visible changes after this commit.
---
 gdb/remote.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
  

Comments

Alexandra Petlanova Hajkova Aug. 23, 2023, 9:30 a.m. UTC | #1
On Wed, Aug 16, 2023 at 5:55 PM Andrew Burgess via Gdb-patches <
gdb-patches@sourceware.org> wrote:

> Small refactor, have remote_target::extended_remote_run take the name
> of the executable to run rather than looking it up directly, the one
> caller of this function has already looked up the remote-exec
> filename.
>
> There should be no user visible changes after this commit.
>
> A nice clean up patch.
  

Patch

diff --git a/gdb/remote.c b/gdb/remote.c
index 6fefabac0ce..2b52ccb2555 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1223,7 +1223,8 @@  class remote_target : public process_stratum_target
   void remote_kill_k ();
 
   void extended_remote_disable_randomization (int val);
-  int extended_remote_run (const std::string &args);
+  int extended_remote_run (const char *remote_exec_file,
+			   const std::string &args);
 
   void send_environment_packet (const char *action,
 				const char *packet,
@@ -10448,11 +10449,11 @@  remote_target::extended_remote_disable_randomization (int val)
 }
 
 int
-remote_target::extended_remote_run (const std::string &args)
+remote_target::extended_remote_run (const char *remote_exec_file,
+				    const std::string &args)
 {
   struct remote_state *rs = get_remote_state ();
   int len;
-  const char *remote_exec_file = get_remote_exec_file ();
 
   /* If the user has disabled vRun support, or we have detected that
      support is not available, do not try it.  */
@@ -10647,7 +10648,7 @@  Remote replied unexpectedly while setting startup-with-shell: %s"),
   extended_remote_set_inferior_cwd ();
 
   /* Now restart the remote server.  */
-  run_worked = extended_remote_run (args) != -1;
+  run_worked = extended_remote_run (remote_exec_file, args) != -1;
   if (!run_worked)
     {
       /* vRun was not supported.  Fail if we need it to do what the