From patchwork Fri May 3 23:12:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 32531 Received: (qmail 2294 invoked by alias); 3 May 2019 23:12:56 -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 593 invoked by uid 89); 3 May 2019 23:12:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.6 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=HX-Languages-Length:1621 X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.54.2) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 May 2019 23:12:41 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 01812400C4D16 for ; Fri, 3 May 2019 18:12:40 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id MhM7hcYRFdnCeMhM7hMCRj; Fri, 03 May 2019 18:12:39 -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=OQ8VA0mNkD1ZuF8noX8SvSgCQPfr0oDhZygRwy0mZZ4=; b=ZeBkhc2MaIglnbfAvqlNN58ZjY GlwpgGZqrvGdMIqCCf1JNct65qnOdbGC9tL3y6uou4kNJaN3BUf6+FqZ+KaA5IYs0Vzu/2uQ3bE1i dciIvQGh3yEAwfS/Ga1GJOeQj; 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 1hMhM7-003AAO-PR; Fri, 03 May 2019 18:12:39 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 24/31] Convert mdebugread.c to type-safe registry API Date: Fri, 3 May 2019 17:12:24 -0600 Message-Id: <20190503231231.8954-25-tom@tromey.com> In-Reply-To: <20190503231231.8954-1-tom@tromey.com> References: <20190503231231.8954-1-tom@tromey.com> This changes mdebugread.c to use the type-safe registry API. 2019-05-01 Tom Tromey * mdebugread.c (basic_type_data): Change type. (basic_type, _initialize_mdebugread): Update. --- gdb/ChangeLog | 5 +++++ gdb/mdebugread.c | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 35e7890f357..2b54fef051a 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1358,14 +1358,15 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, /* Basic types. */ -static const struct objfile_data *basic_type_data; +static const struct objfile_key> + basic_type_data; static struct type * basic_type (int bt, struct objfile *objfile) { struct gdbarch *gdbarch = get_objfile_arch (objfile); - struct type **map_bt - = (struct type **) objfile_data (objfile, basic_type_data); + struct type **map_bt = basic_type_data.get (objfile); struct type *tp; if (bt >= btMax) @@ -1375,7 +1376,7 @@ basic_type (int bt, struct objfile *objfile) { map_bt = OBSTACK_CALLOC (&objfile->objfile_obstack, btMax, struct type *); - set_objfile_data (objfile, basic_type_data, map_bt); + basic_type_data.set (objfile, map_bt); } if (map_bt[bt]) @@ -4811,8 +4812,6 @@ elfmdebug_build_psymtabs (struct objfile *objfile, void _initialize_mdebugread (void) { - basic_type_data = register_objfile_data (); - mdebug_register_index = register_symbol_register_impl (LOC_REGISTER, &mdebug_register_funcs); mdebug_regparm_index