}
}
- if (!have_full_symbols (current_program_space)
- && !have_partial_symbols (current_program_space)
+ if (!current_program_space->has_full_symbols ()
+ && !current_program_space->has_partial_symbols ()
&& block == NULL)
error (_("No symbol table is loaded. Use the \"file\" command."));
if (block == par_state->expression_context_block)
= lookup_minimal_symbol (current_program_space, arg.c_str ());
if (msymbol.minsym == NULL)
{
- if (!have_full_symbols (current_program_space)
- && !have_partial_symbols (current_program_space))
+ if (!current_program_space->has_full_symbols ()
+ && !current_program_space->has_partial_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command."));
else
error (_("No symbol \"%s\" in current context."),
and clear NO_END; however, if one of the arguments is blank,
set DUMMY_BEG or DUMMY_END to record that fact. */
- if (!have_full_symbols (current_program_space)
- && !have_partial_symbols (current_program_space))
+ if (!current_program_space->has_full_symbols ()
+ && !current_program_space->has_partial_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command."));
std::vector<symtab_and_line> sals;
= lookup_minimal_symbol (current_program_space, copy.c_str ());
if (msymbol.minsym != NULL)
pstate->push_new<var_msym_value_operation> (msymbol);
- else if (!have_full_symbols (current_program_space)
- && !have_partial_symbols (current_program_space))
+ else if (!current_program_space->has_full_symbols ()
+ && !current_program_space->has_partial_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command"));
else
error (_("No symbol \"%s\" in current context."),
if (msymbol.minsym != NULL)
pstate->push_new<var_msym_value_operation>
(msymbol);
- else if (!have_full_symbols (current_program_space)
- && !have_partial_symbols (current_program_space))
+ else if (!current_program_space->has_full_symbols ()
+ && !current_program_space->has_partial_symbols ())
error (_("No symbol table is loaded. "
"Use the \"file\" command."));
else
if (symbol == NULL)
symbol = "";
- if (!have_full_symbols (current_program_space)
- && !have_partial_symbols (current_program_space)
- && !have_minimal_symbols (current_program_space))
+ if (!current_program_space->has_full_symbols ()
+ && !current_program_space->has_partial_symbols ()
+ && !current_program_space->has_minimal_symbols ())
throw_error (NOT_FOUND_ERROR,
_("No symbol table is loaded. Use the \"file\" command."));
if (result.empty ())
{
- if (!have_full_symbols (current_program_space)
- && !have_partial_symbols (current_program_space))
+ if (!current_program_space->has_full_symbols ()
+ && !current_program_space->has_partial_symbols ())
throw_error (NOT_FOUND_ERROR,
_("No symbol table is loaded. "
"Use the \"file\" command."));
return false;
}
-/* See objfiles.h. */
-
-bool
-have_partial_symbols (program_space *pspace)
-{
- for (objfile &ofp : pspace->objfiles ())
- if (ofp.has_partial_symbols ())
- return true;
-
- return false;
-}
-
-/* See objfiles.h. */
-
-bool
-have_full_symbols (program_space *pspace)
-{
- for (objfile &ofp : pspace->objfiles ())
- if (ofp.has_full_symbols ())
- return true;
-
- return false;
-}
-
-
/* See objfiles.h. */
void
}
}
-/* See objfiles.h. */
-
-bool
-have_minimal_symbols (program_space *pspace)
-{
- for (objfile &ofp : pspace->objfiles ())
- if (ofp.per_bfd->minimal_symbol_count > 0)
- return true;
-
- return false;
-}
-
/* Qsort comparison function. */
static bool
gdb::array_view<const CORE_ADDR>);
extern void objfile_rebase (struct objfile *, CORE_ADDR);
-/* Return true if any objfile of PSPACE has partial symbols. */
-
-extern bool have_partial_symbols (program_space *pspace);
-
-/* Return true if any objfile of PSPACE has full symbols. */
-
-extern bool have_full_symbols (program_space *pspace);
-
extern void objfile_set_sym_fns (struct objfile *objfile,
const struct sym_fns *sf);
/* Functions for dealing with the minimal symbol table, really a misc
address<->symbol mapping for things we don't have debug symbols for. */
-/* Return true if any objfile of PSPACE has minimal symbols. */
-
-extern bool have_minimal_symbols (program_space *pspace);
-
extern struct obj_section *find_pc_section (CORE_ADDR pc);
/* Return true if PC is in a section called NAME. */
if (msymbol.minsym != NULL)
pstate->push_new<var_msym_value_operation>
(msymbol);
- else if (!have_full_symbols (current_program_space)
- && !have_partial_symbols (current_program_space))
+ else if (!current_program_space->has_full_symbols ()
+ && !current_program_space->has_partial_symbols ())
error (_("No symbol table is loaded. "
"Use the \"file\" command."));
else
= lookup_minimal_symbol (current_program_space, name);
if (msymbol.minsym != NULL)
push_new<expr::var_msym_value_operation> (msymbol);
- else if (!have_full_symbols (current_program_space)
- && !have_partial_symbols (current_program_space))
+ else if (!current_program_space->has_full_symbols ()
+ && !current_program_space->has_partial_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command."));
else
error (_("No symbol \"%s\" in current context."), name);
return *retval;
}
+/* See progspace.h. */
+
+bool
+program_space::has_partial_symbols ()
+{
+ for (objfile &ofp : objfiles ())
+ if (ofp.has_partial_symbols ())
+ return true;
+
+ return false;
+}
+
+/* See progspace.h. */
+
+bool
+program_space::has_full_symbols ()
+{
+ for (objfile &ofp : objfiles ())
+ if (ofp.has_full_symbols ())
+ return true;
+
+ return false;
+}
+
+/* See progspace.h. */
+
+bool
+program_space::has_minimal_symbols ()
+{
+ for (objfile &ofp : objfiles ())
+ if (ofp.per_bfd->minimal_symbol_count > 0)
+ return true;
+
+ return false;
+}
+
/* Prints the list of program spaces and their details on UIOUT. If
REQUESTED is not -1, it's the ID of the pspace that should be
printed. Otherwise, all spaces are printed. */
it is not known. */
CORE_ADDR entry_point_address () const;
+ /* Return true if any objfile of this program space has partial
+ symbols. */
+ bool has_partial_symbols ();
+
+ /* Return true if any objfile of this program space has full
+ symbols. */
+ bool has_full_symbols ();
+
+ /* Return true if any objfile of this program space has minimal
+ symbols. */
+ bool has_minimal_symbols ();
+
/* Unique ID number. */
int num = 0;
void
set_default_source_symtab_and_line (void)
{
- if (!have_full_symbols (current_program_space)
- && !have_partial_symbols (current_program_space))
+ if (!current_program_space->has_full_symbols ()
+ && !current_program_space->has_partial_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command."));
/* Pull in a current source symtab if necessary. */
if (from_tty
&& (always_confirm
- || ((have_full_symbols (current_program_space)
- || have_partial_symbols (current_program_space))
+ || ((current_program_space->has_full_symbols ()
+ || current_program_space->has_partial_symbols ())
&& mainline))
&& !query (_("Load new symbol table from \"%s\"? "), name))
error (_("Not confirmed."));
void
symbol_file_clear (int from_tty)
{
- if ((have_full_symbols (current_program_space)
- || have_partial_symbols (current_program_space))
+ if ((current_program_space->has_full_symbols ()
+ || current_program_space->has_partial_symbols ())
&& from_tty
&& (current_program_space->symfile_object_file
? !query (_("Discard symbol table from `%s'? "),
static void
info_sources_command (const char *args, int from_tty)
{
- if (!have_full_symbols (current_program_space)
- && !have_partial_symbols (current_program_space))
+ if (!current_program_space->has_full_symbols ()
+ && !current_program_space->has_partial_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command."));
filename_partial_match_opts match_opts;
const char *base_name;
struct add_partial_filename_data datum;
- if (!have_full_symbols (current_program_space)
- && !have_partial_symbols (current_program_space))
+ if (!current_program_space->has_full_symbols ()
+ && !current_program_space->has_partial_symbols ())
return list;
filename_seen_cache filenames_seen;
if (tui_location.addr () == 0)
{
- if (have_full_symbols (current_program_space)
- || have_partial_symbols (current_program_space))
+ if (current_program_space->has_full_symbols ()
+ || current_program_space->has_partial_symbols ())
{
set_default_source_symtab_and_line ();
symtab_and_line sal