[10/10] gdb: remote the get_remote_exec_file function

Message ID c699ccc89e5ec96396db38d29d7ae5ca9b49341f.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 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed

Commit Message

Andrew Burgess Aug. 16, 2023, 3:55 p.m. UTC
  After the previous commit, the get_remote_exec_file function is only
used in one place, so inline it and delete get_remote_exec_file.

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

Comments

Mark Wielaard Aug. 23, 2023, 1:42 p.m. UTC | #1
Hi Andrew,

On Wed, 2023-08-16 at 16:55 +0100, Andrew Burgess wrote:
> After the previous commit, the get_remote_exec_file function is only
> used in one place, so inline it and delete get_remote_exec_file.
> 
> There should be no user visible changes after this commit.

This looks sane to me. Is the subject a clever joke or a typo?
It made me smile, but also I had to read it three times before I
understood what was really going on. Maybe s/remote the/remove the/ for
clarity?

Reviewed-by: Mark Wielaard <mark@klomp.org>

> ---
>  gdb/remote.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/gdb/remote.c b/gdb/remote.c
> index e2d21c65b70..966bacd7fb5 100644
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
> @@ -1864,16 +1864,6 @@ remote_target::get_remote_state ()
>    return &m_remote_state;
>  }
>  
> -/* Fetch the remote exec-file from the current program space.  */
> -
> -static const std::string &
> -get_remote_exec_file ()
> -{
> -  const remote_exec_file_info &info
> -    = get_remote_exec_file_info (current_program_space);
> -  return info.first;
> -}
> -
>  /* Set the remote exec file for PSPACE.  */
>  
>  static void
> @@ -1900,7 +1890,9 @@ set_remote_exec_file_cb (const std::string &filename)
>  static const std::string &
>  get_remote_exec_file_cb ()
>  {
> -  return get_remote_exec_file ();
> +  const remote_exec_file_info &info
> +    = get_remote_exec_file_info (current_program_space);
> +  return info.first;
>  }
>  
>  /* Implement the "show remote exec-file" command.  */
  

Patch

diff --git a/gdb/remote.c b/gdb/remote.c
index e2d21c65b70..966bacd7fb5 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1864,16 +1864,6 @@  remote_target::get_remote_state ()
   return &m_remote_state;
 }
 
-/* Fetch the remote exec-file from the current program space.  */
-
-static const std::string &
-get_remote_exec_file ()
-{
-  const remote_exec_file_info &info
-    = get_remote_exec_file_info (current_program_space);
-  return info.first;
-}
-
 /* Set the remote exec file for PSPACE.  */
 
 static void
@@ -1900,7 +1890,9 @@  set_remote_exec_file_cb (const std::string &filename)
 static const std::string &
 get_remote_exec_file_cb ()
 {
-  return get_remote_exec_file ();
+  const remote_exec_file_info &info
+    = get_remote_exec_file_info (current_program_space);
+  return info.first;
 }
 
 /* Implement the "show remote exec-file" command.  */