aboutsummaryrefslogtreecommitdiff
path: root/gdb/fbsd-tdep.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-06-25 17:54:55 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-07-23 15:38:54 -0400
commitfd2dec2a45a73154d9824071ebb8664a39a69174 (patch)
tree2297cdb9fa147b25a87d354a0f7e1452f71a64d3 /gdb/fbsd-tdep.c
parent90cc31c9e59a75122c2371fdf43f53d91e6ad5d6 (diff)
downloadgdb-fd2dec2a45a73154d9824071ebb8664a39a69174.zip
gdb-fd2dec2a45a73154d9824071ebb8664a39a69174.tar.gz
gdb-fd2dec2a45a73154d9824071ebb8664a39a69174.tar.bz2
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
Diffstat (limited to 'gdb/fbsd-tdep.c')
-rw-r--r--gdb/fbsd-tdep.c6
1 files changed, 3 insertions, 3 deletions
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,