]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: add gdb_rl_tilde_expand util
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 23 Oct 2025 16:34:23 +0000 (12:34 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 24 Oct 2025 15:02:22 +0000 (11:02 -0400)
commitf9e262e1cb7af35aeaafae7d078b134f8ab8b3cf
tree9264efe4a8e26ed18a3250282acc9742f230357f
parent5f71957b2331b754fb5c4fb0a35fa4bc3efd85ab
gdb: add gdb_rl_tilde_expand util

Add gdb_rl_tilde_expand, a wrapper around readline's tilde_expand that
returns a gdb::unique_xmalloc_ptr<char>.  Change all callers of
tilde_expand to use gdb_rl_tilde_expand (even the couple of spots that
release it immediatly, for consistency).  This simplifies a few callers.

The name gdb_tilde_expand is already taken by a home-made implementation
in gdbsupport/gdb_tilde_expand.{h.cc}.  I wonder if we could just use
that one instead of readline's tilde_expand, but that's an orthogonal
question.  I don't know how they differ, and I don't want to introduce
behavior changes in this patch.

Change-Id: I6d34eef19f86473226df4ae56d07dc01912e3131
Approved-By: Tom Tromey <tom@tromey.com>
21 files changed:
gdb/auto-load.c
gdb/breakpoint.c
gdb/cli/cli-cmds.c
gdb/cli/cli-dump.c
gdb/cli/cli-setshow.c
gdb/compile/compile-object-load.c
gdb/completer.c
gdb/corelow.c
gdb/exec.c
gdb/gcore.c
gdb/jit.c
gdb/psymtab.c
gdb/python/python.c
gdb/solib.c
gdb/source.c
gdb/symfile.c
gdb/symmisc.c
gdb/target-descriptions.c
gdb/tracefile-tfile.c
gdb/utils.c
gdb/utils.h