/* Definitions for symbol file management in GDB.
- Copyright (C) 1992-2020 Free Software Foundation, Inc.
+ Copyright (C) 1992-2021 Free Software Foundation, Inc.
This file is part of GDB.
struct objstats
{
- /* Number of partial symbols read. */
- int n_psyms = 0;
-
/* Number of full symbols read. */
int n_syms = 0;
GDB typically reads symbols twice -- first an initial scan which just
reads "partial symbols"; these are partial information for the
- static/global symbols in a symbol file. When later looking up symbols,
- objfile->sf->qf->lookup_symbol is used to check if we only have a partial
+ static/global symbols in a symbol file. When later looking up
+ symbols, lookup_symbol is used to check if we only have a partial
symbol and if so, read and expand the full compunit. */
struct objfile
return per_bfd->gdbarch;
}
+ /* Return true if OBJFILE has partial symbols. */
+
+ bool has_partial_symbols ();
+
+ /* See quick_symbol_functions. */
+ struct symtab *find_last_source_symtab ();
+
+ /* See quick_symbol_functions. */
+ void forget_cached_source_info ();
+
+ /* See quick_symbol_functions. */
+ bool map_symtabs_matching_filename
+ (const char *name, const char *real_path,
+ gdb::function_view<bool (symtab *)> callback);
+
+ /* See quick_symbol_functions. */
+ struct compunit_symtab *lookup_symbol (block_enum kind, const char *name,
+ domain_enum domain);
+
+ /* See quick_symbol_functions. */
+ void print_stats ();
+
+ /* See quick_symbol_functions. */
+ void dump ();
+
+ /* See quick_symbol_functions. */
+ void expand_symtabs_for_function (const char *func_name);
+
+ /* See quick_symbol_functions. */
+ void expand_all_symtabs ();
+
+ /* See quick_symbol_functions. */
+ void expand_symtabs_with_fullname (const char *fullname);
+
+ /* See quick_symbol_functions. */
+ void map_matching_symbols
+ (const lookup_name_info &name, domain_enum domain,
+ int global,
+ gdb::function_view<symbol_found_callback_ftype> callback,
+ symbol_compare_ftype *ordered_compare);
+
+ /* See quick_symbol_functions. */
+ void 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,
+ enum search_domain kind);
+
+ /* See quick_symbol_functions. */
+ struct compunit_symtab *find_pc_sect_compunit_symtab
+ (struct bound_minimal_symbol msymbol,
+ CORE_ADDR pc,
+ struct obj_section *section,
+ int warn_if_readin);
+
+ /* See quick_symbol_functions. */
+ void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
+ int need_fullname);
+
+ /* See quick_symbol_functions. */
+ struct compunit_symtab *find_compunit_symtab_by_address (CORE_ADDR address);
+
+ /* See quick_symbol_functions. */
+ enum language lookup_global_symbol_language (const char *name,
+ domain_enum domain,
+ bool *symbol_found_p);
+
/* The object file's original name as specified by the user,
made absolute, and tilde-expanded. However, it is not canonicalized
allocated on the objfile's obstack. */
htab_up static_links;
- /* JIT-related data for this objfile. */
- std::unique_ptr<jit_objfile_data> jit_data = nullptr;
+ /* JIT-related data for this objfile, if the objfile is a JITer;
+ that is, it produces JITed objfiles. */
+ std::unique_ptr<jiter_objfile_data> jiter_data = nullptr;
+
+ /* JIT-related data for this objfile, if the objfile is JITed;
+ that is, it was produced by a JITer. */
+ std::unique_ptr<jited_objfile_data> jited_data = nullptr;
+
+ /* A flag that is set to true if the JIT interface symbols are not
+ found in this objfile, so that we can skip the symbol lookup the
+ next time. If an objfile does not have the symbols, it will
+ never have them. */
+ bool skip_jit_symbol_lookup = false;
};
/* A deleter for objfile. */
extern void objfile_relocate (struct objfile *, const section_offsets &);
extern void objfile_rebase (struct objfile *, CORE_ADDR);
-extern int objfile_has_partial_symbols (struct objfile *objfile);
-
extern int objfile_has_full_symbols (struct objfile *objfile);
extern int objfile_has_symbols (struct objfile *objfile);
OBJF_SHARED objfile of PSPACE and false otherwise. */
extern bool shared_objfile_contains_address_p (struct program_space *pspace,
- CORE_ADDR address);
+ CORE_ADDR address);
/* This operation deletes all objfile entries that represent solibs that
weren't explicitly loaded by the user, via e.g., the add-symbol-file
static inline int
in_plt_section (CORE_ADDR pc)
{
- return pc_in_section (pc, ".plt");
+ return (pc_in_section (pc, ".plt")
+ || pc_in_section (pc, ".plt.sec"));
}
/* Keep a registry of per-objfile data-pointers required by other GDB