From patchwork Fri May 3 23:12:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 32539 Received: (qmail 70421 invoked by alias); 3 May 2019 23:31:28 -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 70405 invoked by uid 89); 3 May 2019 23:31:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.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.1 spammy= X-HELO: gateway23.websitewelcome.com Received: from gateway23.websitewelcome.com (HELO gateway23.websitewelcome.com) (192.185.48.251) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 May 2019 23:31:27 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway23.websitewelcome.com (Postfix) with ESMTP id CE085579B for ; Fri, 3 May 2019 18:31:25 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id MheHhZoM9YTGMMheHhe4JI; Fri, 03 May 2019 18:31:25 -0500 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=HZiFbhfNxzHsmuYGdvqU4wPLLe9Mhxuf7FrdNj6htDc=; b=INI+NjLrnAnylF6HNB3P3wNDDs 90G6OCT0xtvNMgGH376DY+W87k1COVF0vlWTiZ96w5v/9qgqsT4IHKYYV/r/p/A5VraTA+OUr8CKF 5/cn6arusC4sPzDnzIHzL8g+w; Received: from 97-122-168-123.hlrn.qwest.net ([97.122.168.123]:37502 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1hMhM9-003AAO-Lo; Fri, 03 May 2019 18:12:41 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 30/31] Convert dwarf2-frame.c to type-safe registry API Date: Fri, 3 May 2019 17:12:30 -0600 Message-Id: <20190503231231.8954-31-tom@tromey.com> In-Reply-To: <20190503231231.8954-1-tom@tromey.com> References: <20190503231231.8954-1-tom@tromey.com> This changes dwarf2-frame.c to use the type-safe registry API. 2019-05-02 Tom Tromey * dwarf2-frame.c (dwarf2_frame_objfile_data): Change type. (dwarf2_frame_find_fde, dwarf2_build_frame_info) (_initialize_dwarf2_frame): Update. --- gdb/ChangeLog | 6 ++++++ gdb/dwarf2-frame.c | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index b697afa5a13..0f2502b4c68 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -1463,7 +1463,9 @@ dwarf2_frame_cfa (struct frame_info *this_frame) return get_frame_base (this_frame); } -const struct objfile_data *dwarf2_frame_objfile_data; +const struct objfile_key> + dwarf2_frame_objfile_data; static unsigned int read_1_byte (bfd *abfd, const gdb_byte *buf) @@ -1708,13 +1710,11 @@ dwarf2_frame_find_fde (CORE_ADDR *pc, CORE_ADDR *out_offset) CORE_ADDR offset; CORE_ADDR seek_pc; - fde_table = ((struct dwarf2_fde_table *) - objfile_data (objfile, dwarf2_frame_objfile_data)); + fde_table = dwarf2_frame_objfile_data.get (objfile); if (fde_table == NULL) { dwarf2_build_frame_info (objfile); - fde_table = ((struct dwarf2_fde_table *) - objfile_data (objfile, dwarf2_frame_objfile_data)); + fde_table = dwarf2_frame_objfile_data.get (objfile); } gdb_assert (fde_table != NULL); @@ -2397,7 +2397,7 @@ dwarf2_build_frame_info (struct objfile *objfile) xfree (fde_table.entries); } - set_objfile_data (objfile, dwarf2_frame_objfile_data, fde_table2); + dwarf2_frame_objfile_data.set (objfile, fde_table2); } /* Handle 'maintenance show dwarf unwinders'. */ @@ -2416,7 +2416,6 @@ void _initialize_dwarf2_frame (void) { dwarf2_frame_data = gdbarch_data_register_pre_init (dwarf2_frame_init); - dwarf2_frame_objfile_data = register_objfile_data (); add_setshow_boolean_cmd ("unwinders", class_obscure, &dwarf2_frame_unwinders_enabled_p , _("\