[binutils-gdb] gdb/solib-svr4: make svr4_info::debug_loader_name an std::string
Simon Marchi
simark@sourceware.org
Thu Jun 5 15:41:05 GMT 2025
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f118937c181f008f78496d299873c879648d2d1a
commit f118937c181f008f78496d299873c879648d2d1a
Author: Simon Marchi <simon.marchi@efficios.com>
Date: Tue Jun 3 12:45:14 2025 -0400
gdb/solib-svr4: make svr4_info::debug_loader_name an std::string
Remove some manual memory management.
Change-Id: I9c752d35a70e3659509fed57df1c9a8d27ecc742
Approved-By: Tom Tromey <tom@tromey.com>
Diff:
---
gdb/solib-svr4.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 5a8b08edacd..b7af602c333 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -368,7 +368,7 @@ struct svr4_info
CORE_ADDR debug_loader_offset = 0;
/* Name of the dynamic linker, valid if debug_loader_offset_p. */
- char *debug_loader_name = nullptr;
+ std::string debug_loader_name;
/* Load map address for the main executable in default namespace. */
CORE_ADDR main_lm_addr = 0;
@@ -2681,7 +2681,7 @@ enable_break (struct svr4_info *info, int from_tty)
if (!loader_found_in_list)
{
- info->debug_loader_name = xstrdup (interp_name);
+ info->debug_loader_name = interp_name;
info->debug_loader_offset_p = 1;
info->debug_loader_offset = load_addr;
solib_add (NULL, from_tty, auto_solib_add);
@@ -3341,8 +3341,7 @@ svr4_clear_solib (program_space *pspace)
info->debug_base = 0;
info->debug_loader_offset_p = 0;
info->debug_loader_offset = 0;
- xfree (info->debug_loader_name);
- info->debug_loader_name = NULL;
+ info->debug_loader_name.clear ();
}
/* Clear any bits of ADDR that wouldn't fit in a target-format
More information about the Gdb-cvs
mailing list