This commit:
  commit 
53cf95c3389a3ecd97276d322e4a60fe3396a201
  Date:   Wed Dec 14 14:17:44 2022 +0000
      gdb: make more use of make_target_connection_string
Introduced a couple of inefficient uses of std::string, both of which
are fixed in this commit.
There should be no user visible changes after this commit.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
 
     return {};
   else
     {
-      std::string conn_str
-       = make_target_connection_string (proc_target).c_str ();
+      std::string conn_str = make_target_connection_string (proc_target);
       return string_printf ("%d (%s)", proc_target->connection_number,
                            conn_str.c_str ());
     }
 
 
       process_stratum_target *t = it.second;
 
-      size_t l = strlen (make_target_connection_string (t).c_str ());
+      size_t l = make_target_connection_string (t).length ();
       if (l > what_len)
        what_len = l;
     }