From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFA 07/15] Change symbol_set_names to take an objfile_per_bfd_storage
Date: Thu, 10 May 2018 22:25:00 -0000 [thread overview]
Message-ID: <20180510222357.27332-8-tom@tromey.com> (raw)
In-Reply-To: <20180510222357.27332-1-tom@tromey.com>
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 <tom@tromey.com>
* 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"
--
2.13.6
next prev parent reply other threads:[~2018-05-10 22:25 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-10 22:25 [RFA 00/15] Work toward making psymtabs reusable Tom Tromey
2018-05-10 22:25 ` [RFA 10/15] Introduce objfile::reset_psymtabs Tom Tromey
2018-07-18 14:04 ` Simon Marchi
2018-05-10 22:25 ` Tom Tromey [this message]
2018-05-10 22:25 ` [RFA 15/15] Move psymtabs to their own obstack Tom Tromey
2018-07-18 14:41 ` Simon Marchi
2018-09-23 21:34 ` Tom Tromey
2018-05-10 22:25 ` [RFA 03/15] Remove parameters from start_psymtab_common Tom Tromey
2018-07-17 15:41 ` Simon Marchi
2018-05-10 22:25 ` [RFA 04/15] Change add_psymbol_to_list to use an enum Tom Tromey
2018-07-18 2:41 ` Simon Marchi
2018-05-10 22:25 ` [RFA 02/15] Remove some unneeded psymtab initializations Tom Tromey
2018-07-17 15:27 ` Simon Marchi
2018-07-18 2:29 ` Simon Marchi
2018-05-10 22:25 ` [RFA 11/15] Allocate the address map on the psymtab obstack Tom Tromey
2018-07-18 14:08 ` Simon Marchi
2018-05-10 22:25 ` [RFA 08/15] Remove readin and compunit_symtab fields from psymtab Tom Tromey
2018-07-18 3:34 ` Simon Marchi
2018-07-18 18:56 ` Tom Tromey
2018-09-28 5:02 ` Tom Tromey
2018-10-06 1:24 ` Tom Tromey
2018-10-07 22:04 ` Simon Marchi
2018-10-08 0:01 ` Tom Tromey
2018-05-10 22:25 ` [RFA 06/15] Change create_demangled_names_hash to take an objfile_per_bfd_storage Tom Tromey
2018-07-18 2:52 ` Simon Marchi
2018-05-10 22:25 ` [RFA 05/15] Simplify calls to init_psymbol_list Tom Tromey
2018-07-18 2:51 ` Simon Marchi
2018-09-23 21:12 ` Tom Tromey
2018-05-10 22:25 ` [RFA 01/15] Move some declarations to mdebugread.h Tom Tromey
2018-07-17 15:20 ` Simon Marchi
2018-05-10 22:25 ` [RFA 14/15] Make psymtab_storage::free_psymtabs private Tom Tromey
2018-07-18 14:36 ` Simon Marchi
2018-09-23 21:13 ` Tom Tromey
2018-05-10 22:45 ` [RFA 09/15] Introduce class psymtab_storage Tom Tromey
2018-07-18 14:02 ` Simon Marchi
2018-05-11 10:53 ` [RFA 13/15] Add psymtab_storage::allocate_dependencies Tom Tromey
2018-07-18 14:32 ` Simon Marchi
2018-09-23 21:25 ` Tom Tromey
2018-05-11 10:53 ` [RFA 12/15] Move more allocations to psymtab obstack Tom Tromey
2018-07-18 14:24 ` Simon Marchi
2018-06-18 14:42 ` [RFA 00/15] Work toward making psymtabs reusable Tom Tromey
2018-07-16 16:33 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180510222357.27332-8-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox