object's symbol table. */
p = find_pc_sect_psymbol (objfile, tpst, pc, section);
if (p != NULL
- && (SYMBOL_VALUE_ADDRESS (p)
- == BMSYMBOL_VALUE_ADDRESS (msymbol)))
+ && (p->value.address == BMSYMBOL_VALUE_ADDRESS (msymbol)))
return tpst;
/* Also accept the textlow value of a psymtab as a
symbol tables with line information but no debug
symbols (e.g. those produced by an assembler). */
if (p != NULL)
- this_addr = SYMBOL_VALUE_ADDRESS (p);
+ this_addr = p->value.address;
else
this_addr = tpst->textlow;
object's symbol table. */
p = find_pc_sect_psymbol (objfile, pst, pc, section);
if (p == NULL
- || (SYMBOL_VALUE_ADDRESS (p)
- != BMSYMBOL_VALUE_ADDRESS (msymbol)))
+ || (p->value.address != BMSYMBOL_VALUE_ADDRESS (msymbol)))
goto next;
}
{
partial_symbol *p = objfile->global_psymbols[psymtab->globals_offset + i];
- if (SYMBOL_DOMAIN (p) == VAR_DOMAIN
- && PSYMBOL_CLASS (p) == LOC_BLOCK
- && pc >= SYMBOL_VALUE_ADDRESS (p)
- && (SYMBOL_VALUE_ADDRESS (p) > best_pc
+ if (p->domain == VAR_DOMAIN
+ && p->aclass == LOC_BLOCK
+ && pc >= p->value.address
+ && (p->value.address > best_pc
|| (psymtab->textlow == 0
- && best_pc == 0 && SYMBOL_VALUE_ADDRESS (p) == 0)))
+ && best_pc == 0 && p->value.address == 0)))
{
if (section != NULL) /* Match on a specific section. */
{
fixup_psymbol_section (p, objfile);
- if (!matching_obj_sections (SYMBOL_OBJ_SECTION (objfile, p),
+ if (!matching_obj_sections (p->obj_section (objfile),
section))
continue;
}
- best_pc = SYMBOL_VALUE_ADDRESS (p);
+ best_pc = p->value.address;
best = p;
}
}
{
partial_symbol *p = objfile->static_psymbols[psymtab->statics_offset + i];
- if (SYMBOL_DOMAIN (p) == VAR_DOMAIN
- && PSYMBOL_CLASS (p) == LOC_BLOCK
- && pc >= SYMBOL_VALUE_ADDRESS (p)
- && (SYMBOL_VALUE_ADDRESS (p) > best_pc
+ if (p->domain == VAR_DOMAIN
+ && p->aclass == LOC_BLOCK
+ && pc >= p->value.address
+ && (p->value.address > best_pc
|| (psymtab->textlow == 0
- && best_pc == 0 && SYMBOL_VALUE_ADDRESS (p) == 0)))
+ && best_pc == 0 && p->value.address == 0)))
{
if (section != NULL) /* Match on a specific section. */
{
fixup_psymbol_section (p, objfile);
- if (!matching_obj_sections (SYMBOL_OBJ_SECTION (objfile, p),
+ if (!matching_obj_sections (p->obj_section (objfile),
section))
continue;
}
- best_pc = SYMBOL_VALUE_ADDRESS (p);
+ best_pc = p->value.address;
best = p;
}
}
if (psym == NULL)
return;
- if (SYMBOL_SECTION (psym) >= 0)
+ if (psym->section >= 0)
return;
gdb_assert (objfile);
- switch (PSYMBOL_CLASS (psym))
+ switch (psym->aclass)
{
case LOC_STATIC:
case LOC_LABEL:
case LOC_BLOCK:
- addr = SYMBOL_VALUE_ADDRESS (psym);
+ addr = psym->value.address;
break;
default:
/* Nothing else will be listed in the minsyms -- no use looking
return;
}
- fixup_section (&psym->ginfo, addr, objfile);
+ fixup_section (psym, addr, objfile);
}
/* Psymtab version of lookup_symbol. See its definition in
psymbol_name_matches (partial_symbol *psym,
const lookup_name_info &lookup_name)
{
- const language_defn *lang = language_def (SYMBOL_LANGUAGE (psym));
+ const language_defn *lang = language_def (psym->language);
symbol_name_matcher_ftype *name_match
= get_symbol_name_matcher (lang, lookup_name);
- return name_match (SYMBOL_SEARCH_NAME (psym), lookup_name, NULL);
+ return name_match (symbol_search_name (psym), lookup_name, NULL);
}
/* Look in PST for a symbol in DOMAIN whose name matches NAME. Search
center = bottom + (top - bottom) / 2;
gdb_assert (center < top);
- enum language lang = SYMBOL_LANGUAGE (*center);
+ enum language lang = (*center)->language;
const char *lang_ln
= lookup_name.language_lookup_name (lang).c_str ();
- if (ordered_compare (SYMBOL_SEARCH_NAME (*center), lang_ln) >= 0)
+ if (ordered_compare (symbol_search_name (*center), lang_ln) >= 0)
top = center;
else
bottom = center + 1;
while (top <= real_top
&& psymbol_name_matches (*top, lookup_name))
{
- if (symbol_matches_domain (SYMBOL_LANGUAGE (*top),
- SYMBOL_DOMAIN (*top), domain))
+ if (symbol_matches_domain ((*top)->language,
+ (*top)->domain, domain))
return *top;
top++;
}
{
for (psym = start; psym < start + length; psym++)
{
- if (symbol_matches_domain (SYMBOL_LANGUAGE (*psym),
- SYMBOL_DOMAIN (*psym), domain)
+ if (symbol_matches_domain ((*psym)->language,
+ (*psym)->domain, domain)
&& psymbol_name_matches (*psym, lookup_name))
return *psym;
}
if (!(center < top))
internal_error (__FILE__, __LINE__,
_("failed internal consistency check"));
- if (strcmp_iw_ordered (SYMBOL_SEARCH_NAME (*center),
+ if (strcmp_iw_ordered (symbol_search_name (*center),
search_name.get ()) >= 0)
{
top = center;
/* For `case_sensitivity == case_sensitive_off' strcmp_iw_ordered will
search more exactly than what matches SYMBOL_MATCHES_SEARCH_NAME. */
- while (top >= start && SYMBOL_MATCHES_SEARCH_NAME (*top, lookup_name))
+ while (top >= start && symbol_matches_search_name (*top, lookup_name))
top--;
/* Fixup to have a symbol which matches SYMBOL_MATCHES_SEARCH_NAME. */
top++;
- while (top <= real_top && SYMBOL_MATCHES_SEARCH_NAME (*top, lookup_name))
+ while (top <= real_top && symbol_matches_search_name (*top, lookup_name))
{
- if (symbol_matches_domain (SYMBOL_LANGUAGE (*top),
- SYMBOL_DOMAIN (*top), domain))
+ if (symbol_matches_domain ((*top)->language,
+ (*top)->domain, domain))
return *top;
top++;
}
{
for (psym = start; psym < start + length; psym++)
{
- if (symbol_matches_domain (SYMBOL_LANGUAGE (*psym),
- SYMBOL_DOMAIN (*psym), domain)
- && SYMBOL_MATCHES_SEARCH_NAME (*psym, lookup_name))
+ if (symbol_matches_domain ((*psym)->language,
+ (*psym)->domain, domain)
+ && symbol_matches_search_name (*psym, lookup_name))
return *psym;
}
}
for (partial_symbol *psym : objfile->global_psymbols)
{
fixup_psymbol_section (psym, objfile);
- if (SYMBOL_SECTION (psym) >= 0)
- SYMBOL_VALUE_ADDRESS (psym) += ANOFFSET (delta, SYMBOL_SECTION (psym));
+ if (psym->section >= 0)
+ psym->value.address += ANOFFSET (delta, psym->section);
}
for (partial_symbol *psym : objfile->static_psymbols)
{
fixup_psymbol_section (psym, objfile);
- if (SYMBOL_SECTION (psym) >= 0)
- SYMBOL_VALUE_ADDRESS (psym) += ANOFFSET (delta, SYMBOL_SECTION (psym));
+ if (psym->section >= 0)
+ psym->value.address += ANOFFSET (delta, psym->section);
}
objfile->psymbol_map.clear ();
while (count-- > 0)
{
QUIT;
- fprintf_filtered (outfile, " `%s'", SYMBOL_LINKAGE_NAME (*p));
- if (SYMBOL_DEMANGLED_NAME (*p) != NULL)
+ fprintf_filtered (outfile, " `%s'", (*p)->name);
+ if (symbol_demangled_name (*p) != NULL)
{
- fprintf_filtered (outfile, " `%s'", SYMBOL_DEMANGLED_NAME (*p));
+ fprintf_filtered (outfile, " `%s'", symbol_demangled_name (*p));
}
fputs_filtered (", ", outfile);
- switch (SYMBOL_DOMAIN (*p))
+ switch ((*p)->domain)
{
case UNDEF_DOMAIN:
fputs_filtered ("undefined domain, ", outfile);
fputs_filtered ("<invalid domain>, ", outfile);
break;
}
- switch (PSYMBOL_CLASS (*p))
+ switch ((*p)->aclass)
{
case LOC_UNDEF:
fputs_filtered ("undefined", outfile);
break;
}
fputs_filtered (", ", outfile);
- fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (*p)), outfile);
+ fputs_filtered (paddress (gdbarch, (*p)->value.address), outfile);
fprintf_filtered (outfile, "\n");
p++;
}
if ((domain == ALL_DOMAIN
|| (domain == VARIABLES_DOMAIN
- && PSYMBOL_CLASS (*psym) != LOC_TYPEDEF
- && PSYMBOL_CLASS (*psym) != LOC_BLOCK)
+ && (*psym)->aclass != LOC_TYPEDEF
+ && (*psym)->aclass != LOC_BLOCK)
|| (domain == FUNCTIONS_DOMAIN
- && PSYMBOL_CLASS (*psym) == LOC_BLOCK)
+ && (*psym)->aclass == LOC_BLOCK)
|| (domain == TYPES_DOMAIN
- && PSYMBOL_CLASS (*psym) == LOC_TYPEDEF))
+ && (*psym)->aclass == LOC_TYPEDEF))
&& psymbol_name_matches (*psym, lookup_name)
- && (sym_matcher == NULL || sym_matcher (SYMBOL_SEARCH_NAME (*psym))))
+ && (sym_matcher == NULL || sym_matcher (symbol_search_name (*psym))))
{
/* Found a match, so notify our caller. */
result = PST_SEARCHED_AND_FOUND;
{
struct partial_symbol *psym = symbols[start + i];
- if (PSYMBOL_CLASS (psym) == LOC_STATIC)
+ if (psym->aclass == LOC_STATIC)
{
- CORE_ADDR addr = SYMBOL_VALUE_ADDRESS (psym);
+ CORE_ADDR addr = psym->value.address;
if (seen_addrs->find (addr) == seen_addrs->end ())
{
seen_addrs->insert (addr);
std::sort (begin, end, [] (partial_symbol *s1, partial_symbol *s2)
{
- return strcmp_iw_ordered (SYMBOL_SEARCH_NAME (s1),
- SYMBOL_SEARCH_NAME (s2)) < 0;
+ return strcmp_iw_ordered (symbol_search_name (s1),
+ symbol_search_name (s2)) < 0;
});
}
{
unsigned long h = 0;
struct partial_symbol *psymbol = (struct partial_symbol *) addr;
- unsigned int lang = psymbol->ginfo.language;
- unsigned int domain = PSYMBOL_DOMAIN (psymbol);
- unsigned int theclass = PSYMBOL_CLASS (psymbol);
+ unsigned int lang = psymbol->language;
+ unsigned int domain = psymbol->domain;
+ unsigned int theclass = psymbol->aclass;
- h = hash_continue (&psymbol->ginfo.value, sizeof (psymbol->ginfo.value), h);
+ h = hash_continue (&psymbol->value, sizeof (psymbol->value), h);
h = hash_continue (&lang, sizeof (unsigned int), h);
h = hash_continue (&domain, sizeof (unsigned int), h);
h = hash_continue (&theclass, sizeof (unsigned int), h);
/* Note that psymbol names are interned via symbol_set_names, so
there's no need to hash the contents of the name here. */
- h = hash_continue (&psymbol->ginfo.name, sizeof (psymbol->ginfo.name), h);
+ h = hash_continue (&psymbol->name,
+ sizeof (psymbol->name), h);
return h;
}
struct partial_symbol *sym1 = (struct partial_symbol *) addr1;
struct partial_symbol *sym2 = (struct partial_symbol *) addr2;
- return (memcmp (&sym1->ginfo.value, &sym2->ginfo.value,
- sizeof (sym1->ginfo.value)) == 0
- && sym1->ginfo.language == sym2->ginfo.language
- && PSYMBOL_DOMAIN (sym1) == PSYMBOL_DOMAIN (sym2)
- && PSYMBOL_CLASS (sym1) == PSYMBOL_CLASS (sym2)
+ return (memcmp (&sym1->value, &sym2->value,
+ sizeof (sym1->value)) == 0
+ && sym1->language == sym2->language
+ && sym1->domain == sym2->domain
+ && sym1->aclass == sym2->aclass
/* Note that psymbol names are interned via
symbol_set_names, so there's no need to compare the
contents of the name here. */
- && sym1->ginfo.name == sym2->ginfo.name);
+ && sym1->name == sym2->name);
}
/* Initialize a partial symbol bcache. */
{
struct partial_symbol psymbol;
- /* We must ensure that the entire struct has been zeroed before
- assigning to it, because an assignment may not touch some of the
- holes. */
- memset (&psymbol, 0, sizeof (psymbol));
+ psymbol.value.address = coreaddr;
+ psymbol.section = -1;
+ psymbol.domain = domain;
+ psymbol.aclass = theclass;
- SYMBOL_VALUE_ADDRESS (&psymbol) = coreaddr;
- SYMBOL_SECTION (&psymbol) = -1;
- SYMBOL_SET_LANGUAGE (&psymbol, language, &objfile->objfile_obstack);
- PSYMBOL_DOMAIN (&psymbol) = domain;
- PSYMBOL_CLASS (&psymbol) = theclass;
-
- SYMBOL_SET_NAMES (&psymbol, name, namelength, copy_name, objfile);
+ memset (&psymbol.language_specific, 0, sizeof (psymbol.language_specific));
+ psymbol.ada_mangled = 0;
+ symbol_set_language (&psymbol, language, &objfile->objfile_obstack);
+ symbol_set_names (&psymbol, name, namelength, copy_name, objfile);
/* Stash the partial symbol away in the cache. */
return psymbol_bcache_full (&psymbol, objfile->psymbol_cache, added);
length = ps->n_static_syms;
while (length--)
{
- sym = block_lookup_symbol (b, SYMBOL_SEARCH_NAME (*psym),
+ sym = block_lookup_symbol (b, symbol_search_name (*psym),
symbol_name_match_type::SEARCH_NAME,
- SYMBOL_DOMAIN (*psym));
+ (*psym)->domain);
if (!sym)
{
printf_filtered ("Static symbol `");
- puts_filtered (SYMBOL_LINKAGE_NAME (*psym));
+ puts_filtered ((*psym)->name);
printf_filtered ("' only found in ");
puts_filtered (ps->filename);
printf_filtered (" psymtab\n");
length = ps->n_global_syms;
while (length--)
{
- sym = block_lookup_symbol (b, SYMBOL_SEARCH_NAME (*psym),
+ sym = block_lookup_symbol (b, symbol_search_name (*psym),
symbol_name_match_type::SEARCH_NAME,
- SYMBOL_DOMAIN (*psym));
+ (*psym)->domain);
if (!sym)
{
printf_filtered ("Global symbol `");
- puts_filtered (SYMBOL_LINKAGE_NAME (*psym));
+ puts_filtered ((*psym)->name);
printf_filtered ("' only found in ");
puts_filtered (ps->filename);
printf_filtered (" psymtab\n");