Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Guinevere Larsen <guinevere@redhat.com>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 0/2] More uses of make_unique_xstrdup
Date: Thu, 15 Jan 2026 14:39:38 -0300	[thread overview]
Message-ID: <3bf1b983-e7c6-4d76-8c87-9a0d3523d8b3@redhat.com> (raw)
In-Reply-To: <20260115-xstrdup-v1-0-72e13ba99851@adacore.com>

On 1/15/26 2:33 PM, Tom Tromey wrote:
> This replaces some uses of '.reset(xstrdup())' with
> '= make_unique_xstrdup()'.  I think explicit uses of reset
> should be avoided when possible.
>
> Regression tested on x86-64 Fedora 41.
>
> Signed-off-by: Tom Tromey <tromey@adacore.com>

This makes me wonder... is there any reason to prefer xmalloc/xstrdup 
instead of using std::string?

My preference is to use stdlib stuff when possible, but maybe I'm 
misjudging the size of the refactor or there's a reason to prefer the 
current memory strategy.

-- 
Cheers,
Guinevere Larsen
It/she

> ---
> Tom Tromey (2):
>        Use make_unique_xstrdup in more places
>        Use make_unique_xstrdup in tracepoint
>
>   gdb/breakpoint.c            |  4 ++--
>   gdb/buildsym.h              |  8 +++++---
>   gdb/cli/cli-dump.c          |  2 +-
>   gdb/mi/mi-cmd-env.c         |  2 +-
>   gdb/python/py-framefilter.c |  2 +-
>   gdb/python/py-function.c    |  2 +-
>   gdb/python/py-lazy-string.c |  5 ++++-
>   gdb/python/py-param.c       |  2 +-
>   gdb/solib.c                 |  4 ++--
>   gdb/source.c                |  4 ++--
>   gdb/stack.c                 | 16 +++++++++++-----
>   gdb/tracectf.c              |  4 ++--
>   gdb/tracepoint.c            | 10 ++++------
>   gdb/tracepoint.h            | 12 ++++++------
>   14 files changed, 43 insertions(+), 34 deletions(-)
> ---
> base-commit: 44c39324673cd9bb18db67234253f288497d66a1
> change-id: 20260115-xstrdup-00eb39b61e16
>
> Best regards,


  parent reply	other threads:[~2026-01-15 17:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 17:33 Tom Tromey
2026-01-15 17:33 ` [PATCH 1/2] Use make_unique_xstrdup in more places Tom Tromey
2026-01-15 17:33 ` [PATCH 2/2] Use make_unique_xstrdup in tracepoint Tom Tromey
2026-01-15 17:39 ` Guinevere Larsen [this message]
2026-01-15 18:01   ` [PATCH 0/2] More uses of make_unique_xstrdup Simon Marchi
2026-01-15 18:16     ` Guinevere Larsen
2026-01-16 14:14 ` Andrew Burgess

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=3bf1b983-e7c6-4d76-8c87-9a0d3523d8b3@redhat.com \
    --to=guinevere@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.com \
    /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