From fd2dec2a45a73154d9824071ebb8664a39a69174 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 25 Jun 2021 17:54:55 -0400 Subject: gdb: make inferior::m_args an std::string With the current code, both a NULL pointer and an empty string can mean "no arguments". We don't need this distinction. Changing to a string has the advantage that there is now a single state for that (an empty string), which makes the code a bit simpler in my opinion. Change-Id: Icdc622820f7869478791dbaa84b4a1c7fec21ced --- gdb/fbsd-tdep.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/fbsd-tdep.c') diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c index 141d236..07cd844 100644 --- a/gdb/fbsd-tdep.c +++ b/gdb/fbsd-tdep.c @@ -684,9 +684,9 @@ fbsd_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size) const char *fname = lbasename (get_exec_file (0)); std::string psargs = fname; - const char *infargs = current_inferior ()->args (); - if (infargs != NULL) - psargs = psargs + " " + infargs; + const std::string &infargs = current_inferior ()->args (); + if (!infargs.empty ()) + psargs += ' ' + infargs; note_data.reset (elfcore_write_prpsinfo (obfd, note_data.release (), note_size, fname, -- cgit v1.1