From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id fvBcKlvE5GAcTAAAWB0awg (envelope-from ) for ; Tue, 06 Jul 2021 17:00:11 -0400 Received: by simark.ca (Postfix, from userid 112) id 9F91E1F1F4; Tue, 6 Jul 2021 17:00:11 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 821C41E54D for ; Tue, 6 Jul 2021 17:00:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D93F638930EF for ; Tue, 6 Jul 2021 21:00:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D93F638930EF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1625605209; bh=+jwHKnEXGP/DjROqJycEN4KceZnn3rTcbmH9iSoE1zE=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=uUuve5p+VkG8pz8Zl2eLUFMG44hhPV296yeXBO8Ms6PVhwFobogMuneplREmQyAUp OBWeOOpapXdWY4qzYhQPH/Ay53UkFgFO/wUzm5j+a/8ENoftp5nBr7oIgI+c4pbXjF vymyx/qqYDAJb2cPDyHigSSuBjfHP+qfwtsohvx8= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id D9C043861035 for ; Tue, 6 Jul 2021 20:59:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D9C043861035 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 166KxeXr024354 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 6 Jul 2021 16:59:45 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 166KxeXr024354 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id BD6AC1E54D; Tue, 6 Jul 2021 16:59:40 -0400 (EDT) Subject: Re: [PATCH 04/11] gdb: use intrusive list for step-over chain To: Pedro Alves , gdb-patches@sourceware.org References: <20210622165704.2404007-1-simon.marchi@polymtl.ca> <20210622165704.2404007-5-simon.marchi@polymtl.ca> <136e1ed0-5a65-dd7f-cc58-34f64cc5895f@palves.net> Message-ID: <66322687-08b2-73aa-3ce4-26f604c8abc7@polymtl.ca> Date: Tue, 6 Jul 2021 16:59:40 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <136e1ed0-5a65-dd7f-cc58-34f64cc5895f@palves.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 6 Jul 2021 20:59:40 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-07-05 11:45 a.m., Pedro Alves wrote: > On 2021-06-22 5:56 p.m., Simon Marchi via Gdb-patches wrote: > >> * reference-to-pointer-iterator.h (struct >> reference_to_pointer_iterator): Add default assignment >> operators. > > It's not immediately obvious why this is needed now, and wasn't before. > It should perhaps be mentioned in the commit log. Especially if you > decide to discard the ChangeLog entry. > > Otherwise LGTM. Hmm right. It's to avoid this error: CXX infrun.o cc1plus: warning: command-line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++ In file included from /home/simark/src/binutils-gdb/gdb/breakpoint.h:36, from /home/simark/src/binutils-gdb/gdb/gdbthread.h:26, from /home/simark/src/binutils-gdb/gdb/infrun.h:21, from /home/simark/src/binutils-gdb/gdb/infrun.c:23: /home/simark/src/binutils-gdb/gdb/../gdbsupport/safe-iterator.h: In instantiation of ‘basic_safe_iterator::self_type& basic_safe_iterator::operator++() [with Iterator = reference_to_pointer_iterator > >; basic_safe_iterator::self_type = basic_safe_iterator > > >]’: /home/simark/src/binutils-gdb/gdb/infrun.c:1883:26: required from here /home/simark/src/binutils-gdb/gdb/../gdbsupport/safe-iterator.h:82:10: error: use of deleted function ‘constexpr reference_to_pointer_iterator > >& reference_to_pointer_iterator > >::operator=(const reference_to_pointer_iterator > >&)’ 82 | m_it = m_next; | ~~~~~^~~~~~~~ In file included from /home/simark/src/binutils-gdb/gdb/thread-iter.h:25, from /home/simark/src/binutils-gdb/gdb/gdbthread.h:516, from /home/simark/src/binutils-gdb/gdb/infrun.h:21, from /home/simark/src/binutils-gdb/gdb/infrun.c:23: /home/simark/src/binutils-gdb/gdb/../gdbsupport/reference-to-pointer-iterator.h:30:8: note: ‘constexpr reference_to_pointer_iterator > >& reference_to_pointer_iterator > >::operator=(const reference_to_pointer_iterator > >&)’ is implicitly declared as deleted because ‘reference_to_pointer_iterator > >’ declares a move constructor or move assignment operator 30 | struct reference_to_pointer_iterator | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So I would say: Add explicit default assignment operators to reference_to_pointer_iterator, which are otherwise implicitly deleted. This is needed because to define thread_step_over_list_safe_iterator, we wrap reference_to_pointer_iterator inside a basic_safe_iterator, and basic_safe_iterator needs to be able to copy-assign the wrapped iterator. The move-assignment operator is therefore not needed, only the copy-assignment operator is. But for completeness, add both. Simon