From patchwork Mon May 21 15:36:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27358 Received: (qmail 122489 invoked by alias); 21 May 2018 15:36:31 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 122470 invoked by uid 89); 21 May 2018 15:36:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:796 X-HELO: gateway34.websitewelcome.com Received: from gateway34.websitewelcome.com (HELO gateway34.websitewelcome.com) (192.185.148.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 May 2018 15:36:28 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 2CF93C4C7C5 for ; Mon, 21 May 2018 10:36:27 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id KmrLfvko0QUwqKmrLfc0aT; Mon, 21 May 2018 10:36:27 -0500 X-Authority-Reason: nr=8 Received: from 174-29-44-154.hlrn.qwest.net ([174.29.44.154]:48884 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fKmrK-001WwK-Kw; Mon, 21 May 2018 10:36:27 -0500 From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA] Use std::unique_ptr in dwarf2_read_debug_names References: <20180519152316.18973-1-tom@tromey.com> <52e98157-98c4-5c73-8e17-338d14d00b55@simark.ca> Date: Mon, 21 May 2018 09:36:23 -0600 In-Reply-To: <52e98157-98c4-5c73-8e17-338d14d00b55@simark.ca> (Simon Marchi's message of "Sun, 20 May 2018 19:49:51 -0400") Message-ID: <87muwt2f7s.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fKmrK-001WwK-Kw X-Source-Sender: 174-29-44-154.hlrn.qwest.net (bapiya) [174.29.44.154]:48884 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes >>>>> "Simon" == Simon Marchi writes: Simon> We maybe could add DISABLE_COPY_AND_ASSIGN to mapped_index_base, to ensure Simon> we don't make copies of mapped_index/mapped_debug_names by mistake. I also needed to default the no-arg constructor. I'm checking it in with the appended addition. Tom diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 9a77502826..49ce83ff20 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -147,6 +147,9 @@ struct name_component struct mapped_index_base { + mapped_index_base () = default; + DISABLE_COPY_AND_ASSIGN (mapped_index_base); + /* The name_component table (a sorted vector). See name_component's description above. */ std::vector name_components;