aboutsummaryrefslogtreecommitdiff
path: root/gdb/bsd-uthread.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-10-08 01:16:29 +0000
committerSimon Marchi <simon.marchi@efficios.com>2023-10-19 10:57:51 -0400
commit98107b0b17acd9d2c28829cbe93a75b72677d220 (patch)
treefcbc63a8764ed76342d61e040e92cc2f61a8764e /gdb/bsd-uthread.c
parent200b85632a99e749e14d1c026b7e24c15a5e2776 (diff)
downloadbinutils-98107b0b17acd9d2c28829cbe93a75b72677d220.zip
binutils-98107b0b17acd9d2c28829cbe93a75b72677d220.tar.gz
binutils-98107b0b17acd9d2c28829cbe93a75b72677d220.tar.bz2
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>
Diffstat (limited to 'gdb/bsd-uthread.c')
-rw-r--r--gdb/bsd-uthread.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index 6435a52..8144f8c 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -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 ();
}