public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>,
	Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 0/7] [gdb/build] Fix -std=c++20 issues
Date: Mon, 21 Aug 2023 13:04:38 +0200	[thread overview]
Message-ID: <e0bef8dd-c61e-d871-513c-56951d7d3065@suse.de> (raw)
In-Reply-To: <87sf8iyh8z.fsf@tromey.com>

On 8/16/23 20:27, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Tom> I tried building gdb using -std=c++20, an ran into a few issues.
> Tom> This series contains fixes for most of them.
> 
> Thanks for doing this.  I read these & sent one comment.
> The rest look ok to me.
> 
> Tom> But the other one, in remote_target::thread_info_to_thread_handle remains
> Tom> unfixed:
> Tom> ...
> Tom> gdb::byte_vector
> Tom> remote_target::thread_info_to_thread_handle (struct thread_info *tp)
> Tom> {
> Tom>   remote_thread_info *priv = get_remote_thread_info (tp);
> Tom>   return priv->thread_handle;
> 
> First, I wonder if we even care about this copying.
> 

Well, I care because I run into a build error:
...
In file included from /usr/include/c++/12/ext/alloc_traits.h:34,
                  from /usr/include/c++/12/unordered_map:41,
                  from /usr/include/c++/12/functional:61,
                  from /data/vries/gdb/src/gdb/../gdbsupport/ptid.h:35,
                  from 
/data/vries/gdb/src/gdb/../gdbsupport/common-defs.h:206,
                  from /data/vries/gdb/src/gdb/defs.h:26,
                  from /data/vries/gdb/src/gdb/remote.c:22:
/usr/include/c++/12/bits/alloc_traits.h: In instantiation of ‘static 
constexpr _Alloc std::allocator_traits< <template-parameter-1-1> 
 >::select_on_container_copy_construction(const _Alloc&) [with _Alloc = 
gdb::default_init_allocator<unsigned char, 
std::pmr::polymorphic_allocator<unsigned char> >]’:
/usr/include/c++/12/ext/alloc_traits.h:98:63:   required from ‘static 
constexpr _Alloc __gnu_cxx::__alloc_traits<_Alloc, 
<template-parameter-1-2> >::_S_select_on_copy(const _Alloc&) [with 
_Alloc = gdb::default_init_allocator<unsigned char, 
std::pmr::polymorphic_allocator<unsigned char> >; 
<template-parameter-1-2> = unsigned char]’
/usr/include/c++/12/bits/stl_vector.h:598:34:   required from ‘constexpr 
std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with 
_Tp = unsigned char; _Alloc = gdb::default_init_allocator<unsigned char, 
std::pmr::polymorphic_allocator<unsigned char> >]’
/data/vries/gdb/src/gdb/remote.c:14557:16:   required from here
/usr/include/c++/12/bits/alloc_traits.h:402:25: error: could not convert 
‘std::allocator_traits<gdb::default_init_allocator<unsigned char, 
std::pmr::polymorphic_allocator<unsigned char> > >::_S_select<const 
gdb::default_init_allocator<unsigned char, 
std::pmr::polymorphic_allocator<unsigned char> > >((* & __rhs), 0)’ from 
‘std::pmr::polymorphic_allocator<unsigned char>’ to 
‘gdb::default_init_allocator<unsigned char, 
std::pmr::polymorphic_allocator<unsigned char> >’
   402 |       { return _S_select(__rhs, 0); }
       |                ~~~~~~~~~^~~~~~~~~~
       |                         |
       | 
std::pmr::polymorphic_allocator<unsigned char>
...

> But if we do, it could return a const reference and linux-thread-db
> could be modified to cache the byte_vector in thread_db_thread_info.

I've managed to get that working, submitted here ( 
https://sourceware.org/pipermail/gdb-patches/2023-August/201727.html ).

Thanks,
- Tom


      reply	other threads:[~2023-08-21 11:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15 18:13 Tom de Vries
2023-08-15 18:13 ` [PATCH 1/7] [gdb/build, c++20] Fix Wdeprecated-enum-enum-conversion Tom de Vries
2023-08-15 18:13 ` [PATCH 2/7] [gdb/build, c++20] Stop using deprecated is_pod Tom de Vries
2023-08-15 18:13 ` [PATCH 3/7] [gdb/build, c++20] Fix DISABLE_COPY_AND_ASSIGN use in ui_out_emit_type Tom de Vries
2023-08-15 18:13 ` [PATCH 4/7] [gdb/build, c++20] Fix deprecated implicit capture of this Tom de Vries
2023-08-15 18:13 ` [PATCH 5/7] [gdb/build, c++20] Fix invalid conversion in test_symbols Tom de Vries
2023-08-15 18:13 ` [PATCH 6/7] [gdb/build] Return reference in target_read_auxv Tom de Vries
2023-08-16 18:23   ` Tom Tromey
2023-08-15 18:13 ` [PATCH 7/7] [gdb/build, c++20] Handle deprecated std::allocator::construct Tom de Vries
2023-08-16 18:27 ` [PATCH 0/7] [gdb/build] Fix -std=c++20 issues Tom Tromey
2023-08-21 11:04   ` Tom de Vries [this message]

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=e0bef8dd-c61e-d871-513c-56951d7d3065@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).