gdb: make so_list::{so_original_name,so_name} std::strings

Change these two fields, simplifying memory management and copying.

Change-Id: If2559284c515721e71e1ef56ada8b64667eebe55
Approved-By: Pedro Alves <pedro@palves.net>
Reviewed-By: Reviewed-By: Lancelot Six <lancelot.six@amd.com>
This commit is contained in:
Simon Marchi
2023-10-08 01:16:29 +00:00
parent 200b85632a
commit 98107b0b17
13 changed files with 68 additions and 80 deletions

View File

@@ -149,7 +149,7 @@ static int bsd_uthread_thread_next_offset = -1;
static int bsd_uthread_thread_ctx_offset;
/* Name of shared threads library. */
static const char *bsd_uthread_solib_name;
static std::string bsd_uthread_solib_name;
/* Non-zero if the thread stratum implemented by this module is active. */
static int bsd_uthread_active;
@@ -245,7 +245,7 @@ bsd_uthread_target::close ()
bsd_uthread_thread_state_offset = 0;
bsd_uthread_thread_next_offset = 0;
bsd_uthread_thread_ctx_offset = 0;
bsd_uthread_solib_name = NULL;
bsd_uthread_solib_name.clear ();
}
/* Deactivate the thread stratum implemented by this module. */
@@ -297,10 +297,10 @@ bsd_uthread_solib_loaded (so_list &so)
static void
bsd_uthread_solib_unloaded (program_space *pspace, const so_list &so)
{
if (!bsd_uthread_solib_name)
if (bsd_uthread_solib_name.empty ())
return;
if (strcmp (so.so_original_name, bsd_uthread_solib_name) == 0)
if (so.so_original_name == bsd_uthread_solib_name)
bsd_uthread_deactivate ();
}