+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.
+
2019-12-15 Christian Biesinger <cbiesinger@google.com>
* ada-exp.y (write_ambiguous_var): Call symbol_set_language to
sym != NULL;
sym = block_iter_match_next (lookup_name, &iter))
{
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
- SYMBOL_DOMAIN (sym), domain))
+ if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain))
{
if (SYMBOL_CLASS (sym) != LOC_UNRESOLVED)
{
ALL_BLOCK_SYMBOLS (block, iter, sym)
{
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+ if (symbol_matches_domain (sym->language (),
SYMBOL_DOMAIN (sym), domain))
{
int cmp;
if (completion_skip_symbol (mode, msymbol))
continue;
- language symbol_language = MSYMBOL_LANGUAGE (msymbol);
+ language symbol_language = msymbol->language ();
/* Ada minimal symbols won't have their language set to Ada. If
we let completion_list_add_name compare using the
continue;
completion_list_add_name (tracker,
- SYMBOL_LANGUAGE (sym),
+ sym->language (),
sym->linkage_name (),
lookup_name, text, word);
}
continue;
completion_list_add_name (tracker,
- SYMBOL_LANGUAGE (sym),
+ sym->language (),
sym->linkage_name (),
lookup_name, text, word);
}
continue;
completion_list_add_name (tracker,
- SYMBOL_LANGUAGE (sym),
+ sym->language (),
sym->linkage_name (),
lookup_name, text, word);
}
b = block_for_pc (ax->scope);
func = block_linkage_function (b);
- lang = language_def (SYMBOL_LANGUAGE (func));
+ lang = language_def (func->language ());
sym = lookup_language_this (lang, b).symbol;
if (!sym)
STRUCT vs VAR domain symbols. So if a matching symbol is found,
make sure there is no "better" matching symbol, i.e., one with
exactly the same domain. PR 16253. */
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+ if (symbol_matches_domain (sym->language (),
SYMBOL_DOMAIN (sym), domain))
other = better_symbol (other, sym, domain);
}
ALL_BLOCK_SYMBOLS_WITH_NAME (block, lookup_name, iter, sym)
{
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+ if (symbol_matches_domain (sym->language (),
SYMBOL_DOMAIN (sym), domain))
{
sym_found = sym;
STRUCT vs VAR domain symbols. So if a matching symbol is found,
make sure there is no "better" matching symbol, i.e., one with
exactly the same domain. PR 16253. */
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
- SYMBOL_DOMAIN (sym), domain))
+ if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain))
other = better_symbol (other, sym, domain);
}
{
/* MATCHER is deliberately called second here so that it never sees
a non-domain-matching symbol. */
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
- SYMBOL_DOMAIN (sym), domain)
+ if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain)
&& matcher (sym, data))
return sym;
}
domain_name (domain));
}
- if (function != NULL && SYMBOL_LANGUAGE (function) == language_cplus)
+ if (function != NULL && function->language () == language_cplus)
{
/* Search the function's template parameters. */
if (SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION (function))
cstk.start_addr, cstk.start_addr + valu);
/* For C++, set the block's scope. */
- if (SYMBOL_LANGUAGE (cstk.name) == language_cplus)
+ if (cstk.name->language () == language_cplus)
cp_set_block_scope (cstk.name, block, &objfile->objfile_obstack);
/* May be switching to an assembler file which may not be using
cstk.start_addr, valu);
/* For C++, set the block's scope. */
- if (SYMBOL_LANGUAGE (cstk.name) == language_cplus)
+ if (cstk.name->language () == language_cplus)
cp_set_block_scope (cstk.name, block,
&objfile->objfile_obstack);
}
/* We don't want to insert a symbol into a dictionary of a different
language. The two may not use the same hashing algorithm. */
- gdb_assert (SYMBOL_LANGUAGE (sym) == DICT_LANGUAGE (dict)->la_language);
+ gdb_assert (sym->language () == DICT_LANGUAGE (dict)->la_language);
- hash = search_name_hash (SYMBOL_LANGUAGE (sym), sym->search_name ());
+ hash = search_name_hash (sym->language (), sym->search_name ());
hash_index = hash % DICT_HASHED_NBUCKETS (dict);
sym->hash_next = buckets[hash_index];
buckets[hash_index] = sym;
{
for (int i = list_counter->nsyms - 1; i >= 0; --i)
{
- enum language language = SYMBOL_LANGUAGE (list_counter->symbol[i]);
+ enum language language = list_counter->symbol[i]->language ();
nsyms[language].push_back (list_counter->symbol[i]);
}
}
mdict_add_symbol (struct multidictionary *mdict, struct symbol *sym)
{
struct dictionary *dict
- = find_language_dictionary (mdict, SYMBOL_LANGUAGE (sym));
+ = find_language_dictionary (mdict, sym->language ());
if (dict == nullptr)
{
/* SYM is of a new language that we haven't previously seen.
Create a new dictionary for it. */
- dict = create_new_language_dictionary (mdict, SYMBOL_LANGUAGE (sym));
+ dict = create_new_language_dictionary (mdict, sym->language ());
}
dict_add_symbol (dict, sym);
{
struct partial_symbol *psym = *psymp;
- if (psym->ginfo.language == language_ada)
+ if (psym->ginfo.language () == language_ada)
error (_("Ada is not currently supported by the index; "
"use the DWARF 5 index instead"));
return;
const char *name = psym->ginfo.search_name ();
- if (psym->ginfo.language == language_ada)
+ if (psym->ginfo.language () == language_ada)
{
/* We want to ensure that the Ada main function's name appears
verbatim in the index. However, this name will be of the
{
struct symbol *sym = list->symbol[i];
- if (SYMBOL_LANGUAGE (sym) == language_go
+ if (sym->language () == language_go
&& SYMBOL_CLASS (sym) == LOC_BLOCK)
{
char *this_package_name = go_symbol_package_name (sym);
read_var_value (struct symbol *var, const struct block *var_block,
struct frame_info *frame)
{
- const struct language_defn *lang = language_def (SYMBOL_LANGUAGE (var));
+ const struct language_defn *lang = language_def (var->language ());
gdb_assert (lang != NULL);
gdb_assert (lang->la_read_var_value != NULL);
/* Found a function. */
sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL).symbol;
/* Don't use line number debug info for assembly source files. */
- if ((sym != NULL) && SYMBOL_LANGUAGE (sym) != language_asm)
+ if ((sym != NULL) && sym->language () != language_asm)
{
sal = find_pc_line (func_addr, 0);
if (sal.end && sal.end < func_end)
char *name_buf;
char *result;
- gdb_assert (SYMBOL_LANGUAGE (sym) == language_go);
+ gdb_assert (sym->language () == language_go);
name_buf = unpack_mangled_go_symbol (mangled_name,
&package_name, &object_name,
&method_type_package_name,
{
m_lang = current_language->la_language;
m_switched = true;
- set_language (SYMBOL_LANGUAGE (sym));
+ set_language (sym->language ());
}
else
{
gdb_assert (!pspace->executing_startup);
set_current_program_space (pspace);
t = check_typedef (SYMBOL_TYPE (sym));
- find_methods (t, SYMBOL_LANGUAGE (sym),
+ find_methods (t, sym->language (),
method_name, &result_names, &superclass_vec);
/* Handle all items from a single program space at once; and be
this program space, consider superclasses. */
if (result_names.size () == last_result_len)
find_superclass_methods (std::move (superclass_vec), method_name,
- SYMBOL_LANGUAGE (sym), &result_names);
+ sym->language (), &result_names);
/* We have a list of candidate symbol names, so now we
iterate over the symbol tables looking for all
ALL_BLOCK_SYMBOLS (block, iter, sym)
{
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+ if (symbol_matches_domain (sym->language (),
SYMBOL_DOMAIN (sym), LABEL_DOMAIN)
&& cmp (sym->search_name (), name, name_len) == 0)
{
/* All functions in C++ have prototypes. For C we don't have enough
information in the debug info. */
- if (SYMBOL_LANGUAGE (s) == language_cplus)
+ if (s->language () == language_cplus)
TYPE_PROTOTYPED (SYMBOL_TYPE (s)) = 1;
/* Create and enter a new lexical context. */
- b = new_block (FUNCTION_BLOCK, SYMBOL_LANGUAGE (s));
+ b = new_block (FUNCTION_BLOCK, s->language ());
SYMBOL_BLOCK_VALUE (s) = b;
BLOCK_FUNCTION (b) = s;
BLOCK_START (b) = BLOCK_END (b) = sh->value;
get_no_prettyformat_print_options (&opts);
opts.deref_ref = 1;
common_val_print (arg->val, &stb, 0, &opts,
- language_def (SYMBOL_LANGUAGE (arg->sym)));
+ language_def (arg->sym->language ()));
}
catch (const gdb_exception_error &except)
{
{
if (sym->demangled_hash_next == NULL)
{
- objfile->per_bfd->demangled_hash_languages.set (MSYMBOL_LANGUAGE (sym));
+ objfile->per_bfd->demangled_hash_languages.set (sym->language ());
struct minimal_symbol **table
= objfile->per_bfd->msymbol_demangled_hash;
build_minimal_symbol_hash_tables. */
if (msym->search_name () != msym->linkage_name ())
hash_values[idx].minsym_demangled_hash
- = search_name_hash (MSYMBOL_LANGUAGE (msym),
- msym->search_name ());
+ = search_name_hash (msym->language (), msym->search_name ());
}
{
/* To limit how long we hold the lock, we only acquire it here
sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL).symbol;
/* Don't use line number debug info for assembly source
files. */
- if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
+ if (sym && sym->language () != language_asm)
{
sal = find_pc_line (func_addr, 0);
if (sal.end && sal.end < func_end)
struct symbol *func = block_linkage_function (block);
if (func != NULL)
- lang = language_def (SYMBOL_LANGUAGE (func));
+ lang = language_def (func->language ());
if (lang == NULL || lang->la_language == language_unknown)
lang = current_language;
}
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);
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 ();
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++;
{
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;
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++;
{
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;
{
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;
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
from the symbol. If mode is not "auto", then the language
has been explicitly set, use that. */
if (language_mode == language_mode_auto)
- *language = language_def (SYMBOL_LANGUAGE (*sym));
+ *language = language_def ((*sym)->language ());
else
*language = current_language;
}
{
if (fa->val == NULL && fa->error == NULL)
return;
- language = language_def (SYMBOL_LANGUAGE (fa->sym));
+ language = language_def (fa->sym->language ());
val = fa->val;
}
else
string_file stb;
fprintf_symbol_filtered (&stb, fa->sym->print_name (),
- SYMBOL_LANGUAGE (fa->sym),
+ fa->sym->language (),
DMGL_PARAMS | DMGL_ANSI);
if (fa->entry_kind == print_entry_values_compact)
{
stb.puts ("=");
fprintf_symbol_filtered (&stb, fa->sym->print_name (),
- SYMBOL_LANGUAGE (fa->sym),
+ fa->sym->language (),
DMGL_PARAMS | DMGL_ANSI);
}
if (fa->entry_kind == print_entry_values_only
normal:
std::string new_name;
- if (SYMBOL_LANGUAGE (sym) == language_cplus)
+ if (sym->language () == language_cplus)
{
char *name = (char *) alloca (p - string + 1);
SYMBOL_SET_NAMES (sym, gdb::string_view (string, p - string), true,
objfile);
- if (SYMBOL_LANGUAGE (sym) == language_cplus)
+ if (sym->language () == language_cplus)
cp_scan_for_anonymous_namespaces (get_buildsym_compunit (), sym,
objfile);
This is important to do, because of forward references:
The cleanup of undefined types stored in undef_types only uses
STRUCT_DOMAIN symbols to perform the replacement. */
- synonym = (SYMBOL_LANGUAGE (sym) == language_ada && p[-2] != 'T');
+ synonym = (sym->language () == language_ada && p[-2] != 'T');
/* Typedef */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
annotate_arg_emitter arg_emitter;
ui_out_emit_tuple tuple_emitter (uiout, NULL);
fprintf_symbol_filtered (&stb, arg->sym->print_name (),
- SYMBOL_LANGUAGE (arg->sym), DMGL_PARAMS | DMGL_ANSI);
+ arg->sym->language (), DMGL_PARAMS | DMGL_ANSI);
if (arg->entry_kind == print_entry_values_compact)
{
/* It is OK to provide invalid MI-like stream as with
stb.puts ("=");
fprintf_symbol_filtered (&stb, arg->sym->print_name (),
- SYMBOL_LANGUAGE (arg->sym),
+ arg->sym->language (),
DMGL_PARAMS | DMGL_ANSI);
}
if (arg->entry_kind == print_entry_values_only
/* Use the appropriate language to display our symbol, unless the
user forced the language to a specific language. */
if (language_mode == language_mode_auto)
- language = language_def (SYMBOL_LANGUAGE (arg->sym));
+ language = language_def (arg->sym->language ());
else
language = current_language;
{
const char *print_name = func->print_name ();
- *funlang = SYMBOL_LANGUAGE (func);
+ *funlang = func->language ();
if (funcp)
*funcp = func;
if (*funlang == language_cplus)
if (msymbol.minsym != NULL)
{
funname.reset (xstrdup (msymbol.minsym->print_name ()));
- *funlang = MSYMBOL_LANGUAGE (msymbol.minsym);
+ *funlang = msymbol.minsym->language ();
}
}
if (func)
{
funname = func->print_name ();
- funlang = SYMBOL_LANGUAGE (func);
+ funlang = func->language ();
if (funlang == language_cplus)
{
/* It seems appropriate to use print_name() here,
if (msymbol.minsym != NULL)
{
funname = msymbol.minsym->print_name ();
- funlang = MSYMBOL_LANGUAGE (msymbol.minsym);
+ funlang = msymbol.minsym->language ();
}
}
calling_frame_info = get_prev_frame (fi);
struct symbol *sym = lookup_symbol (name, NULL, VAR_DOMAIN, NULL).symbol;
if (sym != NULL)
- lang = SYMBOL_LANGUAGE (sym);
+ lang = sym->language ();
}
if (lang == language_unknown)
const char *name,
struct obstack *obstack)
{
- if (gsymbol->language == language_ada)
+ if (gsymbol->language () == language_ada)
{
if (name == NULL)
{
const char *
symbol_get_demangled_name (const struct general_symbol_info *gsymbol)
{
- if (gsymbol->language == language_ada)
+ if (gsymbol->language () == language_ada)
{
if (!gsymbol->ada_mangled)
return NULL;
enum language language,
struct obstack *obstack)
{
- gsymbol->language = language;
- if (gsymbol->language == language_cplus
- || gsymbol->language == language_d
- || gsymbol->language == language_go
- || gsymbol->language == language_objc
- || gsymbol->language == language_fortran)
+ gsymbol->m_language = language;
+ if (language == language_cplus
+ || language == language_d
+ || language == language_go
+ || language == language_objc
+ || language == language_fortran)
{
symbol_set_demangled_name (gsymbol, NULL, obstack);
}
- else if (gsymbol->language == language_ada)
+ else if (language == language_ada)
{
gdb_assert (gsymbol->ada_mangled == 0);
gsymbol->language_specific.obstack = obstack;
char *demangled = NULL;
int i;
- if (gsymbol->language == language_unknown)
- gsymbol->language = language_auto;
+ if (gsymbol->language () == language_unknown)
+ gsymbol->m_language = language_auto;
- if (gsymbol->language != language_auto)
+ if (gsymbol->language () != language_auto)
{
- const struct language_defn *lang = language_def (gsymbol->language);
+ const struct language_defn *lang = language_def (gsymbol->language ());
language_sniff_from_mangled_name (lang, mangled, &demangled);
return demangled;
if (language_sniff_from_mangled_name (lang, mangled, &demangled))
{
- gsymbol->language = l;
+ gsymbol->m_language = l;
return demangled;
}
}
{
struct demangled_name_entry **slot;
- if (gsymbol->language == language_ada)
+ if (gsymbol->language () == language_ada)
{
/* In Ada, we do the symbol lookups using the mangled name, so
we can save some space by not storing the demangled name. */
if (*slot == NULL
/* A C version of the symbol may have already snuck into the table.
This happens to, e.g., main.init (__go_init_main). Cope. */
- || (gsymbol->language == language_go && (*slot)->demangled == nullptr))
+ || (gsymbol->language () == language_go && (*slot)->demangled == nullptr))
{
/* A 0-terminated copy of the linkage name. Callers must set COPY_NAME
to true if the string might not be nullterminated. We have to make
(gdb::string_view (mangled_ptr, linkage_name.length ()));
}
(*slot)->demangled = std::move (demangled_name);
- (*slot)->language = gsymbol->language;
+ (*slot)->language = gsymbol->language ();
}
- else if (gsymbol->language == language_unknown
- || gsymbol->language == language_auto)
- gsymbol->language = (*slot)->language;
+ else if (gsymbol->language () == language_unknown
+ || gsymbol->language () == language_auto)
+ gsymbol->m_language = (*slot)->language;
gsymbol->name = (*slot)->mangled.data ();
if ((*slot)->demangled != nullptr)
const char *
general_symbol_info::natural_name () const
{
- switch (language)
+ switch (language ())
{
case language_cplus:
case language_d:
{
const char *dem_name = NULL;
- switch (language)
+ switch (language ())
{
case language_cplus:
case language_d:
const char *
general_symbol_info::search_name () const
{
- if (language == language_ada)
+ if (language () == language_ada)
return name;
else
return natural_name ();
const lookup_name_info &name)
{
symbol_name_matcher_ftype *name_match
- = get_symbol_name_matcher (language_def (gsymbol->language), name);
+ = get_symbol_name_matcher (language_def (gsymbol->language ()), name);
return name_match (gsymbol->search_name (), name, NULL);
}
if (!SYMBOL_MATCHES_SEARCH_NAME (sym, lookup_name))
return 0;
- if (!symbol_matches_domain (SYMBOL_LANGUAGE (sym),
- slot_domain, domain))
+ if (!symbol_matches_domain (sym->language (), slot_domain, domain))
return 0;
}
}
ALL_BLOCK_SYMBOLS_WITH_NAME (block, name, iter, sym)
{
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
- SYMBOL_DOMAIN (sym), domain))
+ if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain))
{
struct block_symbol block_sym = {sym, block};
const lookup_name_info &lookup_name,
const char *text, const char *word)
{
- completion_list_add_name (tracker, SYMBOL_LANGUAGE (sym),
+ completion_list_add_name (tracker, sym->language (),
sym->natural_name (),
lookup_name, text, word);
}
const lookup_name_info &lookup_name,
const char *text, const char *word)
{
- completion_list_add_name (tracker, MSYMBOL_LANGUAGE (sym),
+ completion_list_add_name (tracker, sym->language (),
sym->natural_name (),
lookup_name, text, word);
}
if (c == TYPE_CODE_UNION || c == TYPE_CODE_STRUCT)
for (j = TYPE_N_BASECLASSES (t); j < TYPE_NFIELDS (t); j++)
if (TYPE_FIELD_NAME (t, j))
- completion_list_add_name (tracker, SYMBOL_LANGUAGE (sym),
+ completion_list_add_name (tracker, sym->language (),
TYPE_FIELD_NAME (t, j),
lookup_name, text, word);
}
void set_linkage_name (const char *linkage_name)
{ name = linkage_name; }
+ enum language language () const
+ { return m_language; }
+
/* Name of the symbol. This is a required field. Storage for the
name is allocated on the objfile_obstack for the associated
objfile. For languages like C++ that make a distinction between
This is used to select one of the fields from the language specific
union above. */
- ENUM_BITFIELD(language) language : LANGUAGE_BITS;
+ ENUM_BITFIELD(language) m_language : LANGUAGE_BITS;
/* This is only used by Ada. If set, then the 'demangled_name' field
of language_specific is valid. Otherwise, the 'obstack' field is
#define SYMBOL_VALUE_COMMON_BLOCK(symbol) (symbol)->value.common_block
#define SYMBOL_BLOCK_VALUE(symbol) (symbol)->value.block
#define SYMBOL_VALUE_CHAIN(symbol) (symbol)->value.chain
-#define SYMBOL_LANGUAGE(symbol) (symbol)->language
#define SYMBOL_SECTION(symbol) (symbol)->section
#define SYMBOL_OBJ_SECTION(objfile, symbol) \
(((symbol)->section >= 0) \
#define MSYMBOL_VALUE_BYTES(symbol) (symbol)->value.bytes
#define MSYMBOL_BLOCK_VALUE(symbol) (symbol)->value.block
#define MSYMBOL_VALUE_CHAIN(symbol) (symbol)->value.chain
-#define MSYMBOL_LANGUAGE(symbol) (symbol)->language
#define MSYMBOL_SECTION(symbol) (symbol)->section
#define MSYMBOL_OBJ_SECTION(objfile, symbol) \
(((symbol)->section >= 0) \
name = nullptr;
value.ivalue = 0;
language_specific.obstack = nullptr;
- language = language_unknown;
+ m_language = language_unknown;
ada_mangled = 0;
section = 0;
/* GCC 4.8.5 (on CentOS 7) does not correctly compile class-
/* Found a function. */
sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL).symbol;
/* Don't use line number debug info for assembly source files. */
- if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
+ if (sym && sym->language () != language_asm)
{
sal = find_pc_line (func_addr, 0);
if (sal.end && sal.end < func_end)