From patchwork Sat Feb 8 15:27:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 37764 Received: (qmail 69464 invoked by alias); 8 Feb 2020 15:28:05 -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 69336 invoked by uid 89); 8 Feb 2020 15:28:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.8 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.1 spammy= X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.53.25) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Feb 2020 15:28:04 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 907F6400C6FD4 for ; Sat, 8 Feb 2020 08:14:37 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 0S1ZjRpcqRP4z0S1ZjuLrg; Sat, 08 Feb 2020 09:28:01 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Sl3f7zhbMNgf9t4FZvlMhsERHul5ZsBNaVKYjKgp2Lw=; b=cV0dZTPMhmFni59NA2hDE/k+XP alPeWYycOnxfD0owlotSVHfycq+qvs7rcJ14Kny/vMuwKxt87+YZnZjVFUt/GrlPcPsxzPpsHkm2b T2edfYS7l3jSqrbjAzlOjXhiy; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:38112 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1j0S1Z-001WwE-71; Sat, 08 Feb 2020 08:28:01 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 5/8] Add per-unit obstack Date: Sat, 8 Feb 2020 08:27:55 -0700 Message-Id: <20200208152758.29385-6-tom@tromey.com> In-Reply-To: <20200208152758.29385-1-tom@tromey.com> References: <20200208152758.29385-1-tom@tromey.com> This adds an auto_obstack to the DWARF frame comp_unit object, and then changes the remaining code here to use the comp_unit obstack rather than the objfile obstack. At this point, all the storage for frame data is self-contained -- that is, it is independent of the objfile. gdb/ChangeLog 2020-02-08 Tom Tromey * dwarf2/frame.c (struct comp_unit) : New member. (decode_frame_entry_1): Use the comp_unit obstack. Change-Id: I8a1af090bcc2811762a38afbbea1512be7d952fb --- gdb/ChangeLog | 5 +++++ gdb/dwarf2/frame.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index 0e74b8e7e68..7e1a744513b 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -158,6 +158,9 @@ struct comp_unit /* The FDE table. */ dwarf2_fde_table fde_table; + + /* Hold data used by this module. */ + auto_obstack obstack; }; static struct dwarf2_fde *dwarf2_frame_find_fde (CORE_ADDR *pc, @@ -1771,7 +1774,7 @@ decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start, if (find_cie (cie_table, cie_pointer)) return end; - cie = XOBNEW (&unit->objfile->objfile_obstack, struct dwarf2_cie); + cie = XOBNEW (&unit->obstack, struct dwarf2_cie); cie->initial_instructions = NULL; cie->cie_pointer = cie_pointer; @@ -1950,7 +1953,7 @@ decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start, if (cie_pointer >= unit->dwarf_frame_size) return NULL; - fde = XOBNEW (&unit->objfile->objfile_obstack, struct dwarf2_fde); + fde = XOBNEW (&unit->obstack, struct dwarf2_fde); fde->cie = find_cie (cie_table, cie_pointer); if (fde->cie == NULL) {