aboutsummaryrefslogtreecommitdiff
path: root/gdb/psymtab.c
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-12-03 17:10:32 -0600
committerChristian Biesinger <cbiesinger@google.com>2019-12-16 00:44:36 -0600
commitc1b5c1ebc938b6dc0277363b8c47d75b0b5a621f (patch)
treecd54633651ff68399debc38f92e762b15b607aa2 /gdb/psymtab.c
parent747cfc8c6bb23d40b3fa987f6c3df9d3a0d7b817 (diff)
downloadgdb-c1b5c1ebc938b6dc0277363b8c47d75b0b5a621f.zip
gdb-c1b5c1ebc938b6dc0277363b8c47d75b0b5a621f.tar.gz
gdb-c1b5c1ebc938b6dc0277363b8c47d75b0b5a621f.tar.bz2
Use an accessor function for general_symbol_info::language
Also renames the member variable to m_language to make code easier to read when more functions become member functions. I was originally hoping to eventually make m_language private (after a few more patches), but unfortunately then it no longer counts as a POD type, which means gdbsupport/poison.h won't let us use memset to initialize this type, which psymtabs rely on to clear padding bytes so that bcache can work properly. gdb/ChangeLog: 2019-12-15 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. * ax-gdb.c (gen_expr): Update. * block.c (block_lookup_symbol): Update. (block_lookup_symbol_primary): Update. (block_find_symbol): Update. * cp-namespace.c (cp_lookup_symbol_imports_or_template): Update. * dbxread.c (process_one_symbol): Update. * dictionary.c (insert_symbol_hashed): Update. (collate_pending_symbols_by_language): Update. (mdict_add_symbol): Update. * dwarf-index-write.c (write_psymbols): Update. * dwarf2read.c (fixup_go_packaging): Update. * findvar.c (read_var_value): Update. * ft32-tdep.c (ft32_skip_prologue): Update. * go-lang.c (go_symbol_package_name): Update. * language.h (scoped_switch_to_sym_language_if_auto:: scoped_switch_to_sym_language_if_auto): Update. * linespec.c (find_method): Update. (find_label_symbols_in_block): Update. * mdebugread.c (parse_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. * minsyms.c (add_minsym_to_demangled_hash_table): Update. (minimal_symbol_reader::install): Update. * moxie-tdep.c (moxie_skip_prologue): Update. * parse.c (parse_exp_in_context): Update. * psymtab.c (psymbol_name_matches): Update. (match_partial_symbol): Update. (lookup_partial_symbol): Update. (psymbol_hash): Update. (psymbol_compare): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * stabsread.c (define_symbol): Update. * stack.c (print_frame_arg): Update. (find_frame_funname): Update. (info_frame_command_core): Update. * symfile.c (set_initial_language): Update. * symtab.c (symbol_set_demangled_name): Update. (symbol_get_demangled_name): Update. (symbol_set_language): Update. (symbol_find_demangled_name): Update. (symbol_set_names): Update. (general_symbol_info::natural_name): Update. (general_symbol_info::demangled_name): Update. (general_symbol_info::search_name): Update. (symbol_matches_search_name): Update. (eq_symbol_entry): Update. (iterate_over_symbols): Update. (completion_list_add_symbol): Update. (completion_list_add_msymbol): Update. (completion_list_add_fields): Update. * symtab.h (struct general_symbol_info) <language>: New function. <language>: Rename to... <m_language>: ...this. (SYMBOL_LANGUAGE): Remove. (MSYMBOL_LANGUAGE): Remove. (struct symbol) <ctor>: Update. * xstormy16-tdep.c (xstormy16_skip_prologue): Update. Change-Id: I6464d477457e61639c63ddf8b145e407a35c235a
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r--gdb/psymtab.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 2cbc6d4..28b452b 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -531,7 +531,7 @@ static bool
psymbol_name_matches (partial_symbol *psym,
const lookup_name_info &lookup_name)
{
- const language_defn *lang = language_def (psym->ginfo.language);
+ const language_defn *lang = language_def (psym->ginfo.language ());
symbol_name_matcher_ftype *name_match
= get_symbol_name_matcher (lang, lookup_name);
return name_match (psym->ginfo.search_name (), lookup_name, NULL);
@@ -581,7 +581,7 @@ match_partial_symbol (struct objfile *objfile,
center = bottom + (top - bottom) / 2;
gdb_assert (center < top);
- enum language lang = (*center)->ginfo.language;
+ enum language lang = (*center)->ginfo.language ();
const char *lang_ln
= name.language_lookup_name (lang).c_str ();
@@ -596,7 +596,7 @@ match_partial_symbol (struct objfile *objfile,
while (top <= real_top
&& psymbol_name_matches (*top, name))
{
- if (symbol_matches_domain ((*top)->ginfo.language,
+ if (symbol_matches_domain ((*top)->ginfo.language (),
(*top)->domain, domain))
return *top;
top++;
@@ -610,7 +610,7 @@ match_partial_symbol (struct objfile *objfile,
{
for (psym = start; psym < start + length; psym++)
{
- if (symbol_matches_domain ((*psym)->ginfo.language,
+ if (symbol_matches_domain ((*psym)->ginfo.language (),
(*psym)->domain, domain)
&& psymbol_name_matches (*psym, name))
return *psym;
@@ -719,7 +719,7 @@ lookup_partial_symbol (struct objfile *objfile,
while (top <= real_top && symbol_matches_search_name (&(*top)->ginfo,
lookup_name))
{
- if (symbol_matches_domain ((*top)->ginfo.language,
+ if (symbol_matches_domain ((*top)->ginfo.language (),
(*top)->domain, domain))
return *top;
top++;
@@ -733,7 +733,7 @@ lookup_partial_symbol (struct objfile *objfile,
{
for (psym = start; psym < start + length; psym++)
{
- if (symbol_matches_domain ((*psym)->ginfo.language,
+ if (symbol_matches_domain ((*psym)->ginfo.language (),
(*psym)->domain, domain)
&& symbol_matches_search_name (&(*psym)->ginfo, lookup_name))
return *psym;
@@ -1526,7 +1526,7 @@ psymbol_hash (const void *addr, int length)
{
unsigned long h = 0;
struct partial_symbol *psymbol = (struct partial_symbol *) addr;
- unsigned int lang = psymbol->ginfo.language;
+ unsigned int lang = psymbol->ginfo.language ();
unsigned int domain = psymbol->domain;
unsigned int theclass = psymbol->aclass;
@@ -1553,7 +1553,7 @@ psymbol_compare (const void *addr1, const void *addr2, int length)
return (memcmp (&sym1->ginfo.value, &sym2->ginfo.value,
sizeof (sym1->ginfo.value)) == 0
- && sym1->ginfo.language == sym2->ginfo.language
+ && sym1->ginfo.language () == sym2->ginfo.language ()
&& sym1->domain == sym2->domain
&& sym1->aclass == sym2->aclass
/* Note that psymbol names are interned via