From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 763B73886C4B for ; Tue, 8 Nov 2022 08:54:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 763B73886C4B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667897642; h=from:from:reply-to:subject:subject: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=2Qzg5OT+8InJ+Vi/skFUEB7HwX8ORTzbhhJFXpLxsh8=; b=FqRL27wxJEexIuK9hLb5Y/wXBHz6aRI2ngOGWFdJ0shlDcbjTphhYJpWhFGfvA2g6myD3E P/L8z6BdfLFQnZQogFmcxOlOPEh3v82Zv7UW30kUnjSvzAjs5/BGB+pkToiAu9fGC8QbKj 98QBt8evm0xQdlNHr/J8wCkHW8vgE8k= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-608-K-PiauN6P72ZLGrMhnc-HA-1; Tue, 08 Nov 2022 03:53:20 -0500 X-MC-Unique: K-PiauN6P72ZLGrMhnc-HA-1 Received: by mail-ej1-f70.google.com with SMTP id qa14-20020a170907868e00b007ae24f77742so7141308ejc.8 for ; Tue, 08 Nov 2022 00:53:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2Qzg5OT+8InJ+Vi/skFUEB7HwX8ORTzbhhJFXpLxsh8=; b=mXZzwn6zOlX1hjFfspJoVeFobUjwcJb1cbcO/74VG+zPXloXZa7BL5GDnGJQ2AU2sd PSliLQKjMbs+qylcaxdBK/uDXki4w1XjeGca/PKBUfUmCENbLJjOGGyCHDzMbv4g/975 EQIaVA74BnR+nqxiuF4MDMnuRcI7i/+3i/ce88SHErpRnYGQcGMrpDceQkJNTMwR0N4n h6L3/rvxdf5xKhMts5uH/JUlq2cip63GnHc95e5idTwi8+vNaPSDRKQ8cTIB+2G8kvrl T8Esdno19Hg+h18uP7uh6D5jhvPxc5jv9DZFJJ/oous/6xeO/xAa1+0xyOZfJFaO6PmB q/5g== X-Gm-Message-State: ACrzQf01MUaLPHTic8GV15qc9n8fEY4vRt4joq+3kJ8GmCixdbEIAg0/ 8tomQ8xaRjG5Od9/i+OS7+pKnWFwYXdxNJ9VELXBvrutIG/38EJiuxntFrMeXejs5nW32TQ9LwL K0n7xl5V5VVmA006H4Glg1Q== X-Received: by 2002:a05:6402:2681:b0:461:cbda:fe4b with SMTP id w1-20020a056402268100b00461cbdafe4bmr55145332edd.124.1667897599053; Tue, 08 Nov 2022 00:53:19 -0800 (PST) X-Google-Smtp-Source: AMsMyM4Wo589qEA2tLJpKU1LFrGmoMVxoSzpN8S7UyFWjzpuTB1C7E9RAZL8XCAajefTzXcvY6V+yg== X-Received: by 2002:a05:6402:2681:b0:461:cbda:fe4b with SMTP id w1-20020a056402268100b00461cbdafe4bmr55145320edd.124.1667897598812; Tue, 08 Nov 2022 00:53:18 -0800 (PST) Received: from [10.43.2.105] (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id m15-20020a50ef0f000000b00461bacee867sm5231980eds.25.2022.11.08.00.53.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Nov 2022 00:53:18 -0800 (PST) Message-ID: <212562a2-1ef2-30b8-1f8d-7db2a17d0af6@redhat.com> Date: Tue, 8 Nov 2022 09:53:17 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH 1/7] gdb: clear other.m_cached_id in frame_info_ptr's move ctor To: Simon Marchi , gdb-patches@sourceware.org References: <20221107155310.2590069-1-simon.marchi@polymtl.ca> From: Bruno Larsen In-Reply-To: <20221107155310.2590069-1-simon.marchi@polymtl.ca> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 07/11/2022 16:53, Simon Marchi via Gdb-patches wrote: > We do it in the move assignment operator, so I think it makes sense to > do it here too for consistency. I don't think it's absolutely necessary > to clear the other object's fields (in other words, copy constructor and > move constructor could be the same), as there is no exclusive resource > being transfered. The important thing is to leave the moved-from object > in an unknown, but valid state. But still, I think that clearing the > fields of the moved-from object is not a bad idea, it helps ensure we > don't rely on the moved-from object after. > > Change-Id: Iee900ff9d25dad51d62765d694f2e01524351340 Seems obvious enough. Reviewed-By: Bruno Larsen -- Cheers, Bruno