43 #include "filenames.h"
59 #define BUNCH_SIZE 127
85 unsigned int hash = 0;
87 while (*
string && *
string !=
'(')
90 if (*
string && *
string !=
'(')
104 unsigned int hash = 0;
174 int needtofreename = 0;
175 const char *modified_name;
178 sfile = lbasename (sfile);
181 modified_name =
name;
188 modified_name = cname;
194 objfile != NULL && found_symbol.
minsym == NULL;
195 objfile = objfile->
next)
199 if (objf == NULL || objf == objfile
209 "lookup_minimal_symbol (%s, %s, %s)\n",
210 name, sfile != NULL ? sfile :
"NULL",
214 for (pass = 1; pass <= 2 && found_symbol.
minsym == NULL; pass++)
222 while (msymbol != NULL && found_symbol.
minsym == NULL)
228 int (*cmp) (
const char *,
const char *);
231 ? strcmp : strcasecmp);
250 || filename_cmp (msymbol->
filename, sfile) == 0)
252 found_file_symbol.
minsym = msymbol;
253 found_file_symbol.
objfile = objfile;
263 if (trampoline_symbol.
minsym == NULL)
265 trampoline_symbol.
minsym = msymbol;
266 trampoline_symbol.
objfile = objfile;
272 found_symbol.
minsym = msymbol;
273 found_symbol.
objfile = objfile;
289 xfree ((
void *) modified_name);
292 if (found_symbol.
minsym != NULL)
297 "lookup_minimal_symbol (...) = %s"
305 if (found_file_symbol.
minsym != NULL)
310 "lookup_minimal_symbol (...) = %s"
313 (found_file_symbol.
minsym));
315 return found_file_symbol;
322 "lookup_minimal_symbol (...) = %s%s\n",
323 trampoline_symbol.
minsym != NULL
326 trampoline_symbol.
minsym != NULL
327 ?
" (trampoline)" :
"");
329 return trampoline_symbol;
352 return sym.
minsym == NULL;
365 int (*cmp) (
const char *,
const char *);
374 (*callback) (iter, user_data);
384 (*callback) (iter, user_data);
402 objfile != NULL && found_symbol.
minsym == NULL;
403 objfile = objfile->
next)
405 if (objf == NULL || objf == objfile
409 msymbol != NULL && found_symbol.
minsym == NULL;
420 found_file_symbol.
minsym = msymbol;
424 found_symbol.
minsym = msymbol;
437 return found_file_symbol;
453 objfile = objfile->
next)
455 if (objf == NULL || objf == objfile
486 objfile = objfile->
next)
488 if (objf == NULL || objf == objfile
499 found_symbol.
minsym = msymbol;
557 struct objfile *best_objfile = NULL;
575 for (objfile = section->
objfile;
589 int best_zero_sized = -1;
620 newobj = (lo + hi) / 2;
635 while (hi < objfile->per_bfd->minimal_symbol_count - 1
701 && best_zero_sized == -1)
703 best_zero_sized = hi;
734 if (best_zero_sized != -1
736 hi = best_zero_sized;
750 if (best_zero_sized != -1)
751 hi = best_zero_sized;
762 && ((best_symbol == NULL) ||
766 best_symbol = &msymbol[hi];
773 result.
minsym = best_symbol;
791 memset (&result, 0,
sizeof (result));
809 memset (&result, 0,
sizeof (result));
830 error (
_(
"GDB cannot resolve STT_GNU_IFUNC symbol at address %s without "
831 "the ELF support compiled in."),
841 error (
_(
"GDB cannot resolve STT_GNU_IFUNC symbol \"%s\" without "
842 "the ELF support compiled in."),
852 _(
"elf_gnu_ifunc_resolver_stop cannot be reached."));
861 _(
"elf_gnu_ifunc_resolver_return_stop cannot be reached."));
904 memset (&result, 0,
sizeof (result));
916 return bfd_get_symbol_leading_char (abfd);
978 struct msym_bunch *newobj;
1004 newobj = XCNEW (
struct msym_bunch);
1005 msym_bunch_index = 0;
1007 msym_bunch = newobj;
1081 return strcmp (name1, name2);
1102 struct msym_bunch *
next;
1104 while (msym_bunch != NULL)
1106 next = msym_bunch->
next;
1167 copyfrom = copyto = msymbol;
1168 while (copyfrom < msymbol + mcount - 1)
1183 *copyto++ = *copyfrom++;
1185 *copyto++ = *copyfrom++;
1186 mcount = copyto - msymbol;
1252 struct msym_bunch *bunch;
1264 "Installing %d minimal symbols of objfile %s.\n",
1293 for (bunch = msym_bunch; bunch != NULL; bunch = bunch->
next)
1296 msymbols[mcount] = bunch->
contents[bindex];
1355 memset (m, 0,
sizeof (*m));
1373 if (section == NULL)
1377 if (msymbol.
minsym != NULL
1400 if (tsymbol != NULL)
struct minimal_symbol * msymbols
static int compare_minimal_symbols(const void *fn1p, const void *fn2p)
struct bound_minimal_symbol lookup_minimal_symbol_by_pc_section(CORE_ADDR pc, struct obj_section *section)
struct bound_minimal_symbol lookup_minimal_symbol_solib_trampoline(const char *name, struct objfile *objf)
#define SECT_OFF_TEXT(objfile)
struct minimal_symbol * hash_next
static void build_minimal_symbol_hash_tables(struct objfile *objfile)
struct obstack storage_obstack
#define MSYMBOL_LINKAGE_NAME(symbol)
struct minimal_symbol contents[BUNCH_SIZE]
struct objfile * separate_debug_objfile_backlink
#define GCC2_COMPILED_FLAG_SYMBOL
#define BMSYMBOL_VALUE_ADDRESS(symbol)
static CORE_ADDR stub_gnu_ifunc_resolve_addr(struct gdbarch *gdbarch, CORE_ADDR pc)
struct type ** const(pascal_builtin_types[])
#define obj_section_offset(s)
static void stub_gnu_ifunc_resolver_return_stop(struct breakpoint *b)
#define SET_MSYMBOL_VALUE_ADDRESS(symbol, new_value)
CORE_ADDR minimal_symbol_upper_bound(struct bound_minimal_symbol minsym)
void prim_record_minimal_symbol(const char *name, CORE_ADDR address, enum minimal_symbol_type ms_type, struct objfile *objfile)
static int frob_address(struct objfile *objfile, CORE_ADDR *pc)
void internal_error(const char *file, int line, const char *fmt,...)
#define obj_section_endaddr(s)
unsigned int symbol_lookup_debug
static int msym_bunch_index
#define MSYMBOL_TARGET_FLAG_2(msymbol)
enum language la_language
#define ALL_OBJFILE_OSECTIONS(objfile, osect)
#define MINIMAL_SYMBOL_HASH_SIZE
struct minimal_symbol * prim_record_minimal_symbol_and_info(const char *name, CORE_ADDR address, enum minimal_symbol_type ms_type, int section, struct objfile *objfile)
#define MSYMBOL_TARGET_FLAG_1(msymbol)
struct objfile_per_bfd_storage * per_bfd
struct bound_minimal_symbol lookup_minimal_symbol_text(const char *name, struct objfile *objf)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
#define obj_section_addr(s)
struct minimal_symbol * lookup_minimal_symbol_by_pc_name(CORE_ADDR pc, const char *name, struct objfile *objf)
#define MSYMBOL_OBJ_SECTION(objfile, symbol)
static struct minimal_symbol * lookup_solib_trampoline_symbol_by_pc(CORE_ADDR pc)
#define MSYMBOL_VALUE_RAW_ADDRESS(symbol)
#define ALL_OBJFILES(obj)
int find_minimal_symbol_address(const char *name, CORE_ADDR *addr, struct objfile *objfile)
struct minimal_symbol * demangled_hash_next
struct target_ops current_target
CORE_ADDR find_solib_trampoline_target(struct frame_info *frame, CORE_ADDR pc)
const char * skip_spaces_const(const char *chp)
struct bound_minimal_symbol lookup_minimal_symbol_and_objfile(const char *name)
static void add_minsym_to_demangled_hash_table(struct minimal_symbol *sym, struct minimal_symbol **table)
CORE_ADDR gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
#define SYMBOL_HASH_NEXT(hash, c)
#define SECT_OFF_DATA(objfile)
void iterate_over_minimal_symbols(struct objfile *objf, const char *name, void(*callback)(struct minimal_symbol *, void *), void *user_data)
#define MSYMBOL_SIZE(msymbol)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
#define MSYMBOL_SEARCH_NAME(symbol)
static int startswith(const char *string, const char *pattern)
struct cleanup * make_cleanup_discard_minimal_symbols(void)
static void do_discard_minimal_symbols_cleanup(void *arg)
char * cp_canonicalize_string(const char *string)
struct obj_section * find_pc_section(CORE_ADDR pc)
const char * objfile_name(const struct objfile *objfile)
unsigned int msymbol_hash(const char *string)
struct ui_file * gdb_stdlog
static int get_symbol_leading_char(bfd *abfd)
void init_minimal_symbol_collection(void)
unsigned long hash(const void *addr, int length)
unsigned int minsyms_read
const char const char int
static const struct gnu_ifunc_fns stub_gnu_ifunc_fns
#define MSYMBOL_TYPE(msymbol)
#define ALL_MSYMBOLS(objfile, m)
const struct language_defn * current_language
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
#define MSYMBOL_SET_NAMES(symbol, linkage_name, len, copy_name, objfile)
static void stub_gnu_ifunc_resolver_stop(struct breakpoint *b)
#define GCC_COMPILED_FLAG_SYMBOL
struct minimal_symbol * minsym
#define MSYMBOL_SECTION(symbol)
const char * host_address_to_string(const void *addr)
struct objfile * objfile_separate_debug_iterate(const struct objfile *parent, const struct objfile *objfile)
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
const char * objfile_debug_name(const struct objfile *objfile)
#define MSYMBOL_MATCHES_SEARCH_NAME(symbol, name)
int in_gnu_ifunc_stub(CORE_ADDR pc)
unsigned int symtab_create_debug
static int stub_gnu_ifunc_resolve_name(const char *function_name, CORE_ADDR *function_address_p)
static void add_minsym_to_hash_table(struct minimal_symbol *sym, struct minimal_symbol **table)
static struct msym_bunch * msym_bunch
#define MSYMBOL_SET_LANGUAGE(symbol, language, obstack)
struct minimal_symbol * msymbol_hash[MINIMAL_SYMBOL_HASH_SIZE]
#define SECT_OFF_BSS(objfile)
int matching_obj_sections(struct obj_section *obj_first, struct obj_section *obj_second)
void terminate_minimal_symbol_table(struct objfile *objfile)
static struct bound_minimal_symbol lookup_minimal_symbol_by_pc_section_1(CORE_ADDR pc_in, struct obj_section *section, int want_trampoline)
struct minimal_symbol * msymbol_demangled_hash[MINIMAL_SYMBOL_HASH_SIZE]
void install_minimal_symbols(struct objfile *objfile)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
struct minimal_symbol * prim_record_minimal_symbol_full(const char *name, int name_len, int copy_name, CORE_ADDR address, enum minimal_symbol_type ms_type, int section, struct objfile *objfile)
static int compact_minimal_symbols(struct minimal_symbol *msymbol, int mcount, struct objfile *objfile)
void error(const char *fmt,...)
#define MSYMBOL_VALUE_ADDRESS(objfile, symbol)
char * copy_name(struct stoken token)
unsigned int msymbol_hash_iw(const char *string)