binutils-gdb/gdb/common
Pedro Alves b02f78f928 Introduce and use make_unique_xstrdup
Adds an utility function to make it shorter to write the common case
of wrapping an xstrdup with a unique_xmalloc_ptr, and uses it
throughout.

Note: I tried to put this in common/common-utils.h near skip_spaces,
etc. but that is included in common/common-defs.h before
common/gdb_unique_ptr.h is included, so it would fail to compile
because gdb::unique_xmalloc_ptr isn't defined at that point yet.  I
tried moving the gdb_unique_ptr.h inclusion before common-utils.h, but
that doesn't work because gdb_unique_ptr.h depends on common-utils.h
for xfree.

gdb/ChangeLog:
2019-06-04  Pedro Alves  <palves@redhat.com>

	* common/gdb_unique_ptr.h (make_unique_xstrdup): New.

	* ada-lang.c (catch_ada_completer): Use make_unique_xstrdup.
	* breakpoint.c (condition_completer): Likewise.
	* cli/cli-dump.c (scan_expression): Likewise.
	* common/filestuff.c (mkdir_recursive): Likewise.
	* common/gdb_tilde_expand.c (gdb_tilde_expand_up)
	* common/pathstuff.c (gdb_realpath, gdb_realpath_keepfile)
	(gdb_abspath): Likewise.
	* compile/compile-cplus-types.c
	(compile_cplus_instance::decl_name): Likewise.
	* completer.c (complete_explicit_location):
	(signal_completer, reg_or_group_completer_1): Likewise.
	* cp-support.c (cp_remove_params_if_any): Likewise.
	* fbsd-tdep.c (fbsd_core_vnode_path): Likewise.
	* guile/scm-safe-call.c (gdbscm_safe_eval_string): Likewise.
	* infcmd.c (strip_bg_char): Likewise.
	* linespec.c (copy_token_string): Likewise.
	* mi/mi-main.c (output_cores): Likewise.
	* psymtab.c (psymtab_search_name):
	* symfile.c (test_set_ext_lang_command): Likewise.
	* target.c (target_fileio_read_stralloc): Likewise.
	* tui/tui-regs.c (tui_reggroup_completer): Likewise.
	* value.c (complete_internalvar): Likewise.

gdb/gdbserver/ChangeLog:
2019-06-04  Pedro Alves  <palves@redhat.com>

	* server.c (captured_main): Use make_unique_xstrdup.
2019-06-04 22:48:32 +01:00
..
agent.c
agent.h
array-view.h
ax.def
break-common.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
btrace-common.c
btrace-common.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
buffer.c
buffer.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
byte-vector.h
cleanups.c Remove basic cleanup code 2019-03-06 16:04:31 -07:00
cleanups.h Remove basic cleanup code 2019-03-06 16:04:31 -07:00
common-debug.c
common-debug.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
common-defs.h On MS-Windows, define _WIN32_WINNT in a single common place. 2019-05-03 10:55:33 +03:00
common-exceptions.c Make exception handling more efficient 2019-04-25 12:59:35 -06:00
common-exceptions.h Make exception handling more efficient 2019-04-25 12:59:35 -06:00
common-gdbthread.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
common-inferior.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
common-regcache.c
common-regcache.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
common-types.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
common-utils.c
common-utils.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
common.host
common.m4
create-version.sh
def-vector.h
default-init-alloc.h
enum-flags.h
environ.c
environ.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
errors.c
errors.h
fileio.c
fileio.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
filestuff.c Introduce and use make_unique_xstrdup 2019-06-04 22:48:32 +01:00
filestuff.h Remove last cleanup from linux-namespaces.c 2019-03-06 16:04:31 -07:00
filtered-iterator.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
format.c
format.h
forward-scope-exit.h
function-view.h
gdb_assert.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_locale.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_optional.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_proc_service.h
gdb_ref_ptr.h Add ATTRIBUTE_UNUSED_RESULT to ref_ptr::release 2019-03-05 08:48:40 -07:00
gdb_setjmp.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_signals.h
gdb_splay_tree.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_string_view.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_string_view.tcc
gdb_sys_time.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_tilde_expand.c Introduce and use make_unique_xstrdup 2019-06-04 22:48:32 +01:00
gdb_tilde_expand.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_unique_ptr.h Introduce and use make_unique_xstrdup 2019-06-04 22:48:32 +01:00
gdb_unlinker.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_vecs.c
gdb_vecs.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_wait.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
hash_enum.h
host-defs.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
job-control.c
job-control.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
mingw-strerror.c
netstuff.c On MS-Windows, define _WIN32_WINNT in a single common place. 2019-05-03 10:55:33 +03:00
netstuff.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
new-op.c Make exception handling more efficient 2019-04-25 12:59:35 -06:00
next-iterator.h
observable.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
offset-type.h
pathstuff.c Introduce and use make_unique_xstrdup 2019-06-04 22:48:32 +01:00
pathstuff.h Add a new function child_path. 2019-02-12 13:56:16 -08:00
poison.h
posix-strerror.c
preprocessor.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
print-utils.c
print-utils.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
ptid.c Make null_ptid and minus_one_ptid "const" 2019-03-12 10:45:37 -06:00
ptid.h Make null_ptid and minus_one_ptid "const" 2019-03-12 10:45:37 -06:00
refcounted-object.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
rsp-low.c
rsp-low.h
run-time-clock.c
run-time-clock.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
safe-iterator.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
scope-exit.h
scoped_fd.h Add ATTRIBUTE_UNUSED_RESULT to scoped_fd 2019-03-05 08:48:40 -07:00
scoped_mmap.c Fix scoped_mmap includes 2019-05-06 21:00:52 -06:00
scoped_mmap.h Fix scoped_mmap includes 2019-05-06 21:00:52 -06:00
scoped_restore.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
selftest.c Rename gdb exception types 2019-04-08 09:05:40 -06:00
selftest.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
signals-state-save-restore.c
signals-state-save-restore.h
signals.c
symbol.h
tdesc.c AArch64: Add half float view to V registers 2019-05-14 10:10:56 +01:00
tdesc.h AArch64: Add half float view to V registers 2019-05-14 10:10:56 +01:00
traits.h
underlying.h
valid-expr.h
vec.c
vec.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
version.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
x86-xstate.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
xml-utils.c
xml-utils.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00