From patchwork Mon May 14 15:36:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27261 Received: (qmail 54313 invoked by alias); 14 May 2018 15:36:16 -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 54299 invoked by uid 89); 14 May 2018 15:36:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 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=UD:dwarf2read.c, dwarf2readc, dwarf2read.c X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.145.190) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 May 2018 15:36:13 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 65AD0607D9D for ; Mon, 14 May 2018 10:36:12 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id IFWGf1YBlbXuJIFWGfKjIc; Mon, 14 May 2018 10:36:12 -0500 X-Authority-Reason: nr=8 Received: from 174-29-44-154.hlrn.qwest.net ([174.29.44.154]:34978 helo=pokyo.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fIFWG-003evd-5t; Mon, 14 May 2018 10:36:12 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Clear rust_unions in rust_union_quirks Date: Mon, 14 May 2018 09:36:02 -0600 Message-Id: <20180514153602.17181-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fIFWG-003evd-5t X-Source-Sender: 174-29-44-154.hlrn.qwest.net (pokyo.Home) [174.29.44.154]:34978 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes It turns out that a dwarf2_cu can remain allocated after psymtab expansion is done, and so it makes sense to clear rust_unions when done processing it. Tested on x86-64 Fedora 27. 2018-05-14 Tom Tromey * dwarf2read.c (rust_union_quirks): Clear rust_unions. --- gdb/ChangeLog | 4 ++++ gdb/dwarf2read.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 67610d7144..d795b4a652 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2018-05-14 Tom Tromey + + * dwarf2read.c (rust_union_quirks): Clear rust_unions. + 2018-05-11 Andrew Burgess * i387-tdep.c (i387_collect_xsave): Use FXSAVE_MXCSR_ADDR not diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 26ec5efc28..575d316cdd 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -10105,6 +10105,8 @@ rust_union_quirks (struct dwarf2_cu *cu) gdb_assert (cu->language == language_rust); for (struct type *type : cu->rust_unions) quirk_rust_enum (type, cu->per_cu->dwarf2_per_objfile->objfile); + /* We don't need this any more. */ + cu->rust_unions.clear (); } /* Return the symtab for PER_CU. This works properly regardless of