aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-aix.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/solib-aix.c
parent200b85632a99e749e14d1c026b7e24c15a5e2776 (diff)
downloadgdb-98107b0b17acd9d2c28829cbe93a75b72677d220.zip
gdb-98107b0b17acd9d2c28829cbe93a75b72677d220.tar.gz
gdb-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/solib-aix.c')
-rw-r--r--gdb/solib-aix.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c
index a9931a6..e5e86c4 100644
--- a/gdb/solib-aix.c
+++ b/gdb/solib-aix.c
@@ -482,11 +482,9 @@ solib_aix_current_sos (void)
so_name = string_printf ("%s(%s)", info.filename.c_str (),
info.member_name.c_str ());
}
- strncpy (new_solib->so_original_name, so_name.c_str (),
- SO_NAME_MAX_PATH_SIZE - 1);
- new_solib->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- memcpy (new_solib->so_name, new_solib->so_original_name,
- SO_NAME_MAX_PATH_SIZE);
+
+ new_solib->so_original_name = so_name;
+ new_solib->so_name = so_name;
new_solib->lm_info = gdb::make_unique<lm_info_aix> (info);
/* Add it to the list. */