for (const auto &sym : ls->labels.label_symbols)
{
struct program_space *pspace
- = symbol_symtab (sym.symbol)->pspace ();
+ = symbol_symtab (sym.symbol)->compunit ()->objfile ()->pspace;
if (symbol_to_sal (&sal, state->funfirstline, sym.symbol)
&& maybe_add_address (state->addr_set, pspace, sal.pc))
for (const auto &sym : ls->function_symbols)
{
program_space *pspace
- = symbol_symtab (sym.symbol)->pspace ();
+ = symbol_symtab (sym.symbol)->compunit ()->objfile ()->pspace;
set_current_program_space (pspace);
/* Don't skip to the first line of the function if we
{
/* Program spaces that are executing startup should have
been filtered out earlier. */
- gdb_assert (!elt->pspace ()->executing_startup);
- set_current_program_space (elt->pspace ());
+ program_space *pspace = elt->compunit ()->objfile ()->pspace;
+
+ gdb_assert (!pspace->executing_startup);
+ set_current_program_space (pspace);
iterate_over_file_blocks (elt, lookup_name, STRUCT_DOMAIN, collector);
iterate_over_file_blocks (elt, lookup_name, VAR_DOMAIN, collector);
}
{
uintptr_t uia, uib;
- uia = (uintptr_t) symbol_symtab (a.symbol)->pspace ();
- uib = (uintptr_t) symbol_symtab (b.symbol)->pspace ();
+ uia = (uintptr_t) symbol_symtab (a.symbol)->compunit ()->objfile ()->pspace;
+ uib = (uintptr_t) symbol_symtab (b.symbol)->compunit ()->objfile ()->pspace;
if (uia < uib)
return true;
/* Program spaces that are executing startup should have
been filtered out earlier. */
- pspace = symbol_symtab (sym)->pspace ();
+ pspace = symbol_symtab (sym)->compunit ()->objfile ()->pspace;
gdb_assert (!pspace->executing_startup);
set_current_program_space (pspace);
t = check_typedef (sym->type ());
sure not to miss the last batch. */
if (ix == sym_classes->size () - 1
|| (pspace
- != symbol_symtab (sym_classes->at (ix + 1).symbol)->pspace ()))
+ != (symbol_symtab (sym_classes->at (ix + 1).symbol)
+ ->compunit ()->objfile ()->pspace)))
{
/* If we did not find a direct implementation anywhere in
this program space, consider superclasses. */
for (const auto &elt : function_symbols)
{
fn_sym = elt.symbol;
- set_current_program_space (symbol_symtab (fn_sym)->pspace ());
+ set_current_program_space
+ (symbol_symtab (fn_sym)->compunit ()->objfile ()->pspace);
block = SYMBOL_BLOCK_VALUE (fn_sym);
find_label_symbols_in_block (block, name, fn_sym, completion_mode,
/* The logic above should ensure this. */
gdb_assert (elt != NULL);
- set_current_program_space (elt->pspace ());
+ program_space *pspace = elt->compunit ()->objfile ()->pspace;
+ set_current_program_space (pspace);
/* Simplistic search just for the list command. */
val.symtab = find_line_symtab (elt, val.line, NULL, NULL);
if (val.symtab == NULL)
val.symtab = elt;
- val.pspace = elt->pspace ();
+ val.pspace = pspace;
val.pc = 0;
val.explicit_line = true;
/* The logic above should ensure this. */
gdb_assert (elt != NULL);
- set_current_program_space (elt->pspace ());
+ program_space *pspace = elt->compunit ()->objfile ()->pspace;
+ set_current_program_space (pspace);
pcs = find_pcs_for_symtab_line (elt, line, best_entry);
for (CORE_ADDR pc : pcs)
{
symtab_and_line sal;
- sal.pspace = elt->pspace ();
+ sal.pspace = pspace;
sal.symtab = elt;
sal.line = line;
sal.explicit_line = true;
}
else
{
- if (search_pspace == NULL || symtab->pspace () == search_pspace)
+ program_space *pspace = symtab->compunit ()->objfile ()->pspace;
+
+ if (search_pspace == NULL || pspace == search_pspace)
{
- set_current_program_space (symtab->pspace ());
+ set_current_program_space (pspace);
iterate_over_minimal_symbols
(symtab->compunit ()->objfile (), name,
[&] (struct minimal_symbol *msym)
{ return info->add_symbol (bsym); });
search_minsyms_for_name (info, lookup_name, pspace, NULL);
}
- else if (pspace == NULL || pspace == elt->pspace ())
+ else if (pspace == NULL || pspace == elt->compunit ()->objfile ()->pspace)
{
int prev_len = info->result.symbols->size ();
/* Program spaces that are executing startup should have
been filtered out earlier. */
- gdb_assert (!elt->pspace ()->executing_startup);
- set_current_program_space (elt->pspace ());
+ program_space *elt_pspace = elt->compunit ()->objfile ()->pspace;
+ gdb_assert (!elt_pspace->executing_startup);
+ set_current_program_space (elt_pspace);
iterate_over_file_blocks (elt, lookup_name, VAR_DOMAIN,
[&] (block_symbol *bsym)
{ return info->add_symbol (bsym); });
result->symbol = sym;
result->line = sym->line ();
result->pc = SYMBOL_VALUE_ADDRESS (sym);
- result->pspace = result->symtab->pspace ();
+ result->pspace = result->symtab->compunit ()->objfile ()->pspace;
result->explicit_pc = 1;
return 1;
}
result->symbol = sym;
result->line = sym->line ();
result->pc = SYMBOL_VALUE_ADDRESS (sym);
- result->pspace = result->symtab->pspace ();
+ result->pspace = result->symtab->compunit ()->objfile ()->pspace;
return 1;
}
}