From patchwork Thu May 10 22:23:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27223 Received: (qmail 62987 invoked by alias); 10 May 2018 22:25:08 -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 42138 invoked by uid 89); 10 May 2018 22:24:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=*linkage_name X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.146.78) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 May 2018 22:24:23 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway33.websitewelcome.com (Postfix) with ESMTP id F2218611B7A for ; Thu, 10 May 2018 17:24:06 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id GtyofLxOZQUwqGtyof47z4; Thu, 10 May 2018 17:24:06 -0500 X-Authority-Reason: nr=8 Received: from 97-122-176-117.hlrn.qwest.net ([97.122.176.117]:54520 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fGtyo-001ijL-Ow; Thu, 10 May 2018 17:24:06 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 07/15] Change symbol_set_names to take an objfile_per_bfd_storage Date: Thu, 10 May 2018 16:23:49 -0600 Message-Id: <20180510222357.27332-8-tom@tromey.com> In-Reply-To: <20180510222357.27332-1-tom@tromey.com> References: <20180510222357.27332-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fGtyo-001ijL-Ow X-Source-Sender: 97-122-176-117.hlrn.qwest.net (bapiya.Home) [97.122.176.117]:54520 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes This changes symbol_set_names to take an objfile_per_bfd_storage argument, and updates the users. It also changes PSYMBOL_SET_NAMES to take this argument directly; I feel this clarifies the storage location of objects created in psymtab.c. 2018-05-09 Tom Tromey * symtab.h (SYMBOL_SET_NAMES): Update. (symbol_set_names): Update. (MSYMBOL_SET_NAMES): Update. * symtab.c (symbol_set_names): Change argument to be an objfile_per_bfd_storage. * psymtab.c (add_psymbol_to_bcache): Update. * psympriv.h (PSYMBOL_SET_NAMES): Take per_bfd argument. --- gdb/ChangeLog | 10 ++++++++++ gdb/psympriv.h | 4 ++-- gdb/psymtab.c | 2 +- gdb/symtab.c | 3 +-- gdb/symtab.h | 8 +++++--- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/gdb/psympriv.h b/gdb/psympriv.h index 32c9ee1199..7673eaef39 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -66,8 +66,8 @@ struct partial_symbol #define PSYMBOL_SET_LANGUAGE(symbol,language,obstack) \ (symbol_set_language (&(symbol)->pginfo, (language), (obstack))) -#define PSYMBOL_SET_NAMES(symbol,linkage_name,len,copy_name,objfile) \ - symbol_set_names (&(symbol)->pginfo, linkage_name, len, copy_name, objfile) +#define PSYMBOL_SET_NAMES(symbol,linkage_name,len,copy_name,per_bfd) \ + symbol_set_names (&(symbol)->pginfo, linkage_name, len, copy_name, per_bfd) #define PSYMBOL_LINKAGE_NAME(symbol) (symbol)->pginfo.name #define PSYMBOL_DEMANGLED_NAME(symbol) \ diff --git a/gdb/psymtab.c b/gdb/psymtab.c index c1c8cba800..a966b39730 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1673,7 +1673,7 @@ add_psymbol_to_bcache (const char *name, int namelength, int copy_name, PSYMBOL_DOMAIN (&psymbol) = domain; PSYMBOL_CLASS (&psymbol) = theclass; - PSYMBOL_SET_NAMES (&psymbol, name, namelength, copy_name, objfile); + PSYMBOL_SET_NAMES (&psymbol, name, namelength, copy_name, objfile->per_bfd); /* Stash the partial symbol away in the cache. */ return psymbol_bcache_full (&psymbol, objfile->psymbol_cache, added); diff --git a/gdb/symtab.c b/gdb/symtab.c index 7426770e9e..4af4848859 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -773,13 +773,12 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol, void symbol_set_names (struct general_symbol_info *gsymbol, const char *linkage_name, int len, int copy_name, - struct objfile *objfile) + struct objfile_per_bfd_storage *per_bfd) { struct demangled_name_entry **slot; /* A 0-terminated copy of the linkage name. */ const char *linkage_name_copy; struct demangled_name_entry entry; - struct objfile_per_bfd_storage *per_bfd = objfile->per_bfd; if (gsymbol->language == language_ada) { diff --git a/gdb/symtab.h b/gdb/symtab.h index 84fc897658..cc97452b3d 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -492,10 +492,11 @@ extern void symbol_set_language (struct general_symbol_info *symbol, /* Set the linkage and natural names of a symbol, by demangling the linkage name. */ #define SYMBOL_SET_NAMES(symbol,linkage_name,len,copy_name,objfile) \ - symbol_set_names (&(symbol)->ginfo, linkage_name, len, copy_name, objfile) + symbol_set_names (&(symbol)->ginfo, linkage_name, len, copy_name, \ + (objfile)->per_bfd) extern void symbol_set_names (struct general_symbol_info *symbol, const char *linkage_name, int len, int copy_name, - struct objfile *objfile); + struct objfile_per_bfd_storage *per_bfd); /* Now come lots of name accessor macros. Short version as to when to use which: Use SYMBOL_NATURAL_NAME to refer to the name of the @@ -732,7 +733,8 @@ struct minimal_symbol #define MSYMBOL_SEARCH_NAME(symbol) \ (symbol_search_name (&(symbol)->mginfo)) #define MSYMBOL_SET_NAMES(symbol,linkage_name,len,copy_name,objfile) \ - symbol_set_names (&(symbol)->mginfo, linkage_name, len, copy_name, objfile) + symbol_set_names (&(symbol)->mginfo, linkage_name, len, copy_name, \ + (objfile)->per_bfd) #include "minsyms.h"