86 for (
const auto &iter :
qf)
89 && iter->can_lazily_read_symbols ())
92 retval = iter->has_symbols (
this);
115 if (iter->has_unexpanded_symtabs (
this))
132 struct symtab *retval =
nullptr;
140 retval = iter->find_last_source_symtab (
this);
141 if (retval !=
nullptr)
161 for (
symtab *s : cu->filetabs ())
163 if (s->fullname != NULL)
172 iter->forget_cached_source_info (
this);
177 (
const char *
name,
const char *real_path,
178 gdb::function_view<
bool (
symtab *)> callback)
182 "qf->map_symtabs_matching_filename (%s, \"%s\", "
185 real_path ? real_path : NULL,
186 host_address_to_string (&callback));
189 const char *name_basename = lbasename (
name);
191 auto match_one_filename = [&] (
const char *filename,
bool basenames)
195 if (basenames && FILENAME_CMP (name_basename, filename) == 0)
197 if (real_path !=
nullptr && IS_ABSOLUTE_PATH (filename)
198 && IS_ABSOLUTE_PATH (real_path))
199 return filename_cmp (filename, real_path) == 0;
220 if (!iter->expand_symtabs_matching (
this,
237 "qf->map_symtabs_matching_filename (...) = %d\n",
252 "qf->lookup_symbol (%s, %d, \"%s\", %s)\n",
260 struct symbol *sym, *with_opaque = NULL;
261 const struct blockvector *bv = stab->blockvector ();
276 if (with_opaque !=
nullptr)
285 if (!iter->expand_symtabs_matching (
this,
315 iter->print_stats (
this, print_bcache);
325 for (
const auto &iter :
qf)
334 "qf->expand_symtabs_for_function (%s, \"%s\")\n",
341 iter->expand_symtabs_matching (
this,
360 iter->expand_all_symtabs (
this);
368 "qf->expand_symtabs_with_fullname (%s, \"%s\")\n",
371 const char *basename = lbasename (fullname);
372 auto file_matcher = [&] (
const char *filename,
bool basenames)
374 return filename_cmp (basenames ? basename : fullname, filename) == 0;
378 iter->expand_symtabs_matching (
this,
397 "qf->expand_matching_symbols (%s, %s, %d, %s)\n",
400 host_address_to_string (ordered_compare));
403 iter->expand_matching_symbols (
this,
name, domain, global,
409 (gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
411 gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
412 gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
413 block_search_flags search_flags,
418 gdb_assert (lookup_name !=
nullptr || symbol_matcher ==
nullptr);
422 "qf->expand_symtabs_matching (%s, %s, %s, %s, %s)\n",
424 host_address_to_string (&file_matcher),
425 host_address_to_string (&symbol_matcher),
426 host_address_to_string (&expansion_notify),
430 if (!iter->expand_symtabs_matching (
this, file_matcher, lookup_name,
431 symbol_matcher, expansion_notify,
432 search_flags, domain, kind))
447 "qf->find_pc_sect_compunit_symtab (%s, %s, %s, %s, %d)\n",
449 host_address_to_string (msymbol.
minsym),
451 host_address_to_string (section),
456 retval = iter->find_pc_sect_compunit_symtab (
this, msymbol, pc, section,
458 if (retval !=
nullptr)
464 "qf->find_pc_sect_compunit_symtab (...) = %s\n",
478 "qf->map_symbol_filenames (%s, ..., %d)\n",
483 iter->map_symbol_filenames (
this, fun, need_fullname);
491 "qf->find_compunit_symtab_by_address (%s, %s)\n",
493 hex_string (address));
498 result = iter->find_compunit_symtab_by_address (
this, address);
499 if (result !=
nullptr)
505 "qf->find_compunit_symtab_by_address (...) = %s\n",
516 bool *symbol_found_p)
519 *symbol_found_p =
false;
523 result = iter->lookup_global_symbol_language (
this,
name, domain,
539 bool printed =
false;
540 for (
const auto &iter :
qf)
542 if (iter->can_lazily_read_symbols ())
544 if (verbose && !printed)
546 gdb_printf (_(
"Reading symbols from %ps...\n"),
551 iter->read_partial_symbols (
this);
555 gdb_printf (_(
"(No debugging symbols found in %ps)\n"),
564static const std::vector<std::unique_ptr<probe>> &
570 const std::vector<std::unique_ptr<probe>> &retval
574 "probes->sym_get_probes (%s) = %s\n",
576 host_address_to_string (retval.data ()));
645 host_address_to_string (&info));
656 gdb_assert_not_reached (
"debug_sym_segments called");
681 "sf->sym_relocate (%s, %s, %s) = %s\n",
683 host_address_to_string (sectp),
684 host_address_to_string (buf),
685 host_address_to_string (retval));
725#define COPY_SF_PTR(from, to, name, func) \
728 (to)->debug_sf.name = func; \
819Set debugging of the symfile functions."), _(
"\
820Show debugging of the symfile functions."), _(
"\
821When enabled, all calls to the symfile functions are logged."),
struct symbol * block_find_symbol(const struct block *block, const lookup_name_info &name, const domain_enum domain, struct symbol **stub)
ui_file_style style() const
lookup_name_info make_ignore_params() const
void set(unsigned key, void *datum)
struct cmd_list_element * showdebuglist
struct cmd_list_element * setdebuglist
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
cli_style_option file_name_style
const char * objfile_debug_name(const struct objfile *objfile)
const char * objfile_debug_name(const struct objfile *objfile)
int objfile_has_symbols(struct objfile *objfile)
const char * objfile_name(const struct objfile *objfile)
std::vector< struct program_space * > program_spaces
int symbol_compare_ftype(const char *string1, const char *string2)
const char * symtab_to_filename_for_display(struct symtab *symtab)
struct block * block(size_t i)
struct minimal_symbol * minsym
symtab * primary_filetab() const
const struct sym_fns * real_sf
void forget_cached_source_info()
const struct sym_fns * sf
struct compunit_symtab * compunit_symtabs
struct compunit_symtab * lookup_symbol(block_enum kind, const char *name, domain_enum domain)
void expand_symtabs_with_fullname(const char *fullname)
struct symtab * find_last_source_symtab()
void expand_symtabs_for_function(const char *func_name)
bool expand_symtabs_matching(gdb::function_view< expand_symtabs_file_matcher_ftype > file_matcher, const lookup_name_info *lookup_name, gdb::function_view< expand_symtabs_symbol_matcher_ftype > symbol_matcher, gdb::function_view< expand_symtabs_exp_notify_ftype > expansion_notify, block_search_flags search_flags, domain_enum domain, enum search_domain kind)
void print_stats(bool print_bcache)
bool map_symtabs_matching_filename(const char *name, const char *real_path, gdb::function_view< bool(symtab *)> callback)
void expand_all_symtabs()
void require_partial_symbols(bool verbose)
compunit_symtab_range compunits()
bool has_unexpanded_symtabs()
std::forward_list< quick_symbol_functions_up > qf
enum language lookup_global_symbol_language(const char *name, domain_enum domain, bool *symbol_found_p)
void map_symbol_filenames(gdb::function_view< symbol_filename_ftype > fun, bool need_fullname)
void expand_matching_symbols(const lookup_name_info &name, domain_enum domain, int global, symbol_compare_ftype *ordered_compare)
const std::forward_list< quick_symbol_functions_up > & qf_require_partial_symbols()
struct compunit_symtab * find_compunit_symtab_by_address(CORE_ADDR address)
struct compunit_symtab * find_pc_sect_compunit_symtab(struct bound_minimal_symbol msymbol, CORE_ADDR pc, struct obj_section *section, int warn_if_readin)
bool has_partial_symbols()
bfd_byte *(* sym_relocate)(struct objfile *, asection *sectp, bfd_byte *buf)
void(* sym_read)(struct objfile *, symfile_add_flags)
void(* sym_read_linetable)(struct objfile *)
void(* sym_new_init)(struct objfile *)
void(* sym_init)(struct objfile *)
const struct sym_probe_fns * sym_probe_fns
void(* sym_offsets)(struct objfile *, const section_addr_info &)
void(* sym_finish)(struct objfile *)
const std::vector< std::unique_ptr< probe > > &(* sym_get_probes)(struct objfile *)
static const std::vector< std::unique_ptr< probe > > & debug_sym_get_probes(struct objfile *objfile)
static void debug_sym_new_init(struct objfile *objfile)
void _initialize_symfile_debug()
static void debug_sym_read_linetable(struct objfile *objfile)
static void show_debug_symfile(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void set_debug_symfile(const char *args, int from_tty, struct cmd_list_element *c)
static void debug_sym_finish(struct objfile *objfile)
static const char * debug_symtab_name(struct symtab *symtab)
void objfile_set_sym_fns(struct objfile *objfile, const struct sym_fns *sf)
static const struct sym_probe_fns debug_sym_probe_fns
static void install_symfile_debug_logging(struct objfile *objfile)
static void debug_sym_offsets(struct objfile *objfile, const section_addr_info &info)
static void debug_sym_init(struct objfile *objfile)
static const registry< objfile >::key< debug_sym_fns_data > symfile_debug_objfile_data_key
static int symfile_debug_installed(struct objfile *objfile)
static bfd_byte * debug_sym_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
static void debug_sym_read(struct objfile *objfile, symfile_add_flags symfile_flags)
static bool debug_symfile
static symfile_segment_data_up debug_sym_segments(bfd *abfd)
#define COPY_SF_PTR(from, to, name, func)
static const struct sym_fns debug_sym_fns
static void uninstall_symfile_debug_logging(struct objfile *objfile)
std::unique_ptr< symfile_segment_data > symfile_segment_data_up
std::vector< other_sections > section_addr_info
const char * domain_name(domain_enum e)
bool compare_filenames_for_search(const char *filename, const char *search_name)
const char * search_domain_name(enum search_domain e)
bool iterate_over_some_symtabs(const char *name, const char *real_path, struct compunit_symtab *first, struct compunit_symtab *after_last, gdb::function_view< bool(symtab *)> callback)
static styled_string_s * styled_string(const ui_file_style &style, const char *str, styled_string_s &&tmp={})
void gdb_printf(struct ui_file *stream, const char *format,...)