[gdb/build] Return const reference in target_read_auxv
authorTom de Vries <tdevries@suse.de>
Thu, 17 Aug 2023 08:41:34 +0000 (10:41 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 17 Aug 2023 08:41:34 +0000 (10:41 +0200)
commit9246b7bd6dfeb273f9be7648acffddfe19f966ff
tree24b121116cf815c11b51a81f5f00e878394deb3e
parent2b9ed6db3fb08feab70857dc7eb94fbe6a45e069
[gdb/build] Return const reference in target_read_auxv

In target_read_auxv we return a copy of an object:
...
gdb::optional<gdb::byte_vector>
target_read_auxv ()
{
  ...
  return info->data;
}
...

Return a const reference instead, saving a copy.

This is exposed by using std::pmr::polymorphic_allocator instead of
std::allocator in default_init_allocator.

Tested on x86_64-linux.
gdb/arm-fbsd-tdep.c
gdb/auxv.c
gdb/auxv.h