From: Simon Marchi <simark@simark.ca>
To: John Baldwin <jhb@FreeBSD.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Use std::string for 'psargs'.
Date: Thu, 05 Mar 2020 23:15:00 -0000 [thread overview]
Message-ID: <7d74b9b3-6a10-f32c-9bfc-8ed89aa32629@simark.ca> (raw)
In-Reply-To: <20200305230658.89374-1-jhb@FreeBSD.org>
On 2020-03-05 6:06 p.m., John Baldwin wrote:
> diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
> index bc1b5afd02..ffffb18700 100644
> --- a/gdb/fbsd-tdep.c
> +++ b/gdb/fbsd-tdep.c
> @@ -725,14 +725,14 @@ fbsd_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
> if (get_exec_file (0))
> {
> const char *fname = lbasename (get_exec_file (0));
> - char *psargs = xstrdup (fname);
> + std::string psargs = fname;
>
> - if (get_inferior_args ())
> - psargs = reconcat (psargs, psargs, " ", get_inferior_args (),
> - (char *) NULL);
> + const char *infargs = get_inferior_args ();
> + if (infargs != NULL)
> + psargs = psargs + " " + infargs;
Doesn't really matter, but you could use += here.
LGTM in any case, thanks!
Simon
next prev parent reply other threads:[~2020-03-05 23:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 23:07 John Baldwin
2020-03-05 23:15 ` Simon Marchi [this message]
2020-03-05 23:58 ` John Baldwin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7d74b9b3-6a10-f32c-9bfc-8ed89aa32629@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=jhb@FreeBSD.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox