Re: [PATCH 05/10] remote: remote_arch_state pointers -> remote_arch_state objects

Simon Marchi
2018-05-18T21:09:43Z

On 2018-05-18 05:05 PM, Simon Marchi wrote:
> On 2018-05-16 10:18 AM, Pedro Alves wrote:
>> The previous patch made the map store pointers to remote_arch_state
>> instead of objects directly, simply because struct remote_arch_state
>> is still incomplete where struct remote_state is declared. This patch
>> thus moves the remote_arch_state declaration higher up in the file,
>> and makes the map store remote_arch_state objects directly instead of
>> pointers to objects.
>
> LGTM.
>
> Simon
>

Oops, spoke a bit too soon. It fails to build with g++ 5.4.0 (Ubuntu 16.04).
It doesn't like the "this->m_arch_states.emplace (gdbarch, gdbarch)". With
g++ 7.1.0 it builds fine.

/home/emaisin/src/binutils-gdb/gdb/remote.c:962:61: required from here
/usr/include/c++/5/ext/new_allocator.h:120:4: error: no matching function for call to ‘std::pair<gdbarch* const, remote_arch_state>::pair(gdbarch*&, gdbarch*&)’
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
^

Simon