From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id E7172385841D for ; Mon, 21 Aug 2023 11:04:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E7172385841D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2DA2F20663; Mon, 21 Aug 2023 11:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1692615872; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZKHAz49Dy8SKyYG5KTVRqunSJyhJS9hbXgrNFLpxLh0=; b=GFD6Nn3MWT6cEq2yTyL6c2nKVFqRQJw9no8c+s/6sjxMSpez2AtO3RrL/IqbCKLfWng2WW UtoNAhNekCieq5UFI5wINPjhCypVDR4A9253KVT+TvHTlt4WEHCVa+TD1MDrzJMrnYgRuu CaHeK9WXszb4T6JHC3RqhMtRLPFqrds= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1692615872; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZKHAz49Dy8SKyYG5KTVRqunSJyhJS9hbXgrNFLpxLh0=; b=htJEK0QlQt29sHIwFmqdHfXQA2rU5GWM2SmE1wu22XhIAWSFpOzZxYGDxU67oEpJWSp0/p uzJWFNFHB++6c9AQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 196A213421; Mon, 21 Aug 2023 11:04:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id k8zzBMBE42SoEAAAMHmgww (envelope-from ); Mon, 21 Aug 2023 11:04:32 +0000 Message-ID: Date: Mon, 21 Aug 2023 13:04:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/7] [gdb/build] Fix -std=c++20 issues Content-Language: en-US To: Tom Tromey , Tom de Vries via Gdb-patches References: <20230815181309.8595-1-tdevries@suse.de> <87sf8iyh8z.fsf@tromey.com> From: Tom de Vries In-Reply-To: <87sf8iyh8z.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 8/16/23 20:27, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries via Gdb-patches 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< >::select_on_container_copy_construction(const _Alloc&) [with _Alloc = gdb::default_init_allocator >]’: /usr/include/c++/12/ext/alloc_traits.h:98:63: required from ‘static constexpr _Alloc __gnu_cxx::__alloc_traits<_Alloc, >::_S_select_on_copy(const _Alloc&) [with _Alloc = gdb::default_init_allocator >; = 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 >]’ /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 > >::_S_select > >((* & __rhs), 0)’ from ‘std::pmr::polymorphic_allocator’ to ‘gdb::default_init_allocator >’ 402 | { return _S_select(__rhs, 0); } | ~~~~~~~~~^~~~~~~~~~ | | | std::pmr::polymorphic_allocator ... > 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