From 98107b0b17acd9d2c28829cbe93a75b72677d220 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sun, 8 Oct 2023 01:16:29 +0000 Subject: 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 Reviewed-By: Reviewed-By: Lancelot Six --- gdb/mi/mi-cmd-file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/mi') diff --git a/gdb/mi/mi-cmd-file.c b/gdb/mi/mi-cmd-file.c index 822d3df..30682da 100644 --- a/gdb/mi/mi-cmd-file.c +++ b/gdb/mi/mi-cmd-file.c @@ -165,9 +165,10 @@ mi_cmd_file_list_shared_libraries (const char *command, for (struct so_list *so : current_program_space->solibs ()) { - if (so->so_name[0] == '\0') + if (so->so_name.empty ()) continue; - if (pattern != NULL && !re_exec (so->so_name)) + + if (pattern != nullptr && !re_exec (so->so_name.c_str ())) continue; ui_out_emit_tuple tuple_emitter (uiout, NULL); -- cgit v1.1