+2014-02-26 Tom Tromey <tromey@redhat.com>
+
+ * ada-lang.c (ada_update_initial_language): Update.
+ (ada_main_name, ada_has_this_exception_support): Update.
+ * ada-tasks.c (ada_tasks_inferior_data_sniffer): Update.
+ * aix-thread.c (pdc_symbol_addrs, pd_enable): Update.
+ * arm-tdep.c (arm_skip_stub): Update.
+ * auxv.c (ld_so_xfer_auxv): Update.
+ * avr-tdep.c (avr_scan_prologue): Update.
+ * ax-gdb.c (gen_var_ref): Update.
+ * breakpoint.c (struct breakpoint_objfile_data)
+ <overlay_msym, longjmp_msym, terminate_msym, exception_msym>: Change
+ type to bound_minimal_symbol.
+ (create_overlay_event_breakpoint)
+ (create_longjmp_master_breakpoint)
+ (create_std_terminate_master_breakpoint)
+ (create_exception_master_breakpoint): Update.
+ * bsd-uthread.c (bsd_uthread_lookup_address): Update.
+ * c-exp.y (classify_name): Update.
+ * coffread.c (coff_symfile_read): Update.
+ * common/agent.c (agent_look_up_symbols): Update.
+ * d-lang.c (d_main_name): Update.
+ * dbxread.c (find_stab_function_addr, end_psymtab): Update.
+ * dec-thread.c (enable_dec_thread): Update.
+ * dwarf2loc.c (call_site_to_target_addr): Update.
+ * elfread.c (elf_gnu_ifunc_resolve_by_got): Update.
+ * eval.c (evaluate_subexp_standard): Update.
+ * findvar.c (struct minsym_lookup_data) <result>: Change type
+ to bound_minimal_symbol.
+ <objfile>: Remove.
+ (minsym_lookup_iterator_cb, default_read_var_value): Update.
+ * frame.c (inside_main_func): Update.
+ * frv-tdep.c (frv_frame_this_id): Update.
+ * gcore.c (call_target_sbrk): Update.
+ * glibc-tdep.c (glibc_skip_solib_resolver): Update.
+ * gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline):
+ Update.
+ * go-lang.c (go_main_name): Update.
+ * hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code)
+ (hppa_hpux_find_import_stub_for_addr): Update.
+ * hppa-tdep.c (hppa_extract_17, hppa_lookup_stub_minimal_symbol):
+ Update. Change return type.
+ * hppa-tdep.h (hppa_lookup_stub_minimal_symbol): Change return
+ type.
+ * jit.c (jit_breakpoint_re_set_internal): Update.
+ * linux-fork.c (inferior_call_waitpid, checkpoint_command):
+ Update.
+ * linux-nat.c (get_signo): Update.
+ * linux-thread-db.c (inferior_has_bug): Update
+ * m32c-tdep.c (m32c_return_value)
+ (m32c_m16c_address_to_pointer): Update.
+ * m32r-tdep.c (m32r_frame_this_id): Update.
+ * m68hc11-tdep.c (m68hc11_get_register_info): Update.
+ * machoread.c (macho_resolve_oso_sym_with_minsym): Update.
+ * minsyms.c (lookup_minimal_symbol_internal): Rename to
+ lookup_minimal_symbol. Change return type.
+ (lookup_minimal_symbol): Remove.
+ (lookup_bound_minimal_symbol): Update.
+ (lookup_minimal_symbol_text): Change return type.
+ (lookup_minimal_symbol_solib_trampoline): Change return type.
+ * minsyms.h (lookup_minimal_symbol, lookup_minimal_symbol_text)
+ (lookup_minimal_symbol_solib_trampoline): Change return type.
+ * mips-linux-tdep.c (mips_linux_skip_resolver): Update.
+ * objc-lang.c (lookup_objc_class, lookup_child_selector)
+ (value_nsstring, find_imps): Update.
+ * obsd-tdep.c (obsd_skip_solib_resolver): Update.
+ * p-lang.c (pascal_main_name): Update.
+ * ppc-linux-tdep.c (ppc_linux_spe_context_lookup): Update.
+ * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update.
+ * proc-service.c (ps_pglobal_lookup): Update.
+ * ravenscar-thread.c (get_running_thread_msymbol): Change
+ return type.
+ (has_ravenscar_runtime, get_running_thread_id): Update.
+ * remote.c (remote_check_symbols): Update.
+ * sol-thread.c (ps_pglobal_lookup): Update.
+ * sol2-tdep.c (sol2_skip_solib_resolver): Update.
+ * solib-dsbt.c (lm_base): Update.
+ * solib-frv.c (lm_base, frv_relocate_section_addresses):
+ Update.
+ * solib-irix.c (locate_base): Update.
+ * solib-som.c (som_solib_create_inferior_hook)
+ (som_solib_desire_dynamic_linker_symbols, link_map_start):
+ Update.
+ * solib-spu.c (spu_enable_break): Update.
+ * solib-svr4.c (elf_locate_base, enable_break): Update.
+ * spu-tdep.c (spu_get_overlay_table, spu_catch_start)
+ (flush_ea_cache): Update.
+ * stabsread.c (define_symbol): Update.
+ * symfile.c (simple_read_overlay_table): Update.
+ * symtab.c (find_pc_sect_line): Update.
+ * tracepoint.c (scope_info): Update.
+ * tui-disasm.c (tui_get_begin_asm_address): Update.
+ * value.c (value_static_field): Update.
+
2014-02-26 Tom Tromey <tromey@redhat.com>
* minsyms.c (prim_record_minimal_symbol_full): Use
ada_update_initial_language (enum language lang)
{
if (lookup_minimal_symbol ("adainit", (const char *) NULL,
- (struct objfile *) NULL) != NULL)
+ (struct objfile *) NULL).minsym != NULL)
return language_ada;
return lang;
char *
ada_main_name (void)
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
static char *main_program_name = NULL;
/* For Ada, the name of the main procedure is stored in a specific
in Ada. */
msym = lookup_minimal_symbol (ADA_MAIN_PROGRAM_SYMBOL_NAME, NULL, NULL);
- if (msym != NULL)
+ if (msym.minsym != NULL)
{
CORE_ADDR main_program_name_addr;
int err_code;
- main_program_name_addr = MSYMBOL_VALUE_ADDRESS (msym);
+ main_program_name_addr = MSYMBOL_VALUE_ADDRESS (msym.minsym);
if (main_program_name_addr == 0)
error (_("Invalid address for Ada main program name."));
the name of the exception being raised (this name is printed in
the catchpoint message, and is also used when trying to catch
a specific exception). We do not handle this case for now. */
- struct minimal_symbol *msym
+ struct bound_minimal_symbol msym
= lookup_minimal_symbol (einfo->catch_exception_sym, NULL, NULL);
- if (msym && MSYMBOL_TYPE (msym) != mst_solib_trampoline)
+ if (msym.minsym && MSYMBOL_TYPE (msym.minsym) != mst_solib_trampoline)
error (_("Your Ada runtime appears to be missing some debugging "
"information.\nCannot insert Ada exception catchpoint "
"in this configuration."));
static void
ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
struct symbol *sym;
/* Return now if already set. */
/* Try array. */
msym = lookup_minimal_symbol (KNOWN_TASKS_NAME, NULL, NULL);
- if (msym != NULL)
+ if (msym.minsym != NULL)
{
data->known_tasks_kind = ADA_TASKS_ARRAY;
- data->known_tasks_addr = MSYMBOL_VALUE_ADDRESS (msym);
+ data->known_tasks_addr = MSYMBOL_VALUE_ADDRESS (msym.minsym);
/* Try to get pointer type and array length from the symtab. */
sym = lookup_symbol_in_language (KNOWN_TASKS_NAME, NULL, VAR_DOMAIN,
/* Try list. */
msym = lookup_minimal_symbol (KNOWN_TASKS_LIST, NULL, NULL);
- if (msym != NULL)
+ if (msym.minsym != NULL)
{
data->known_tasks_kind = ADA_TASKS_LIST;
- data->known_tasks_addr = MSYMBOL_VALUE_ADDRESS (msym);
+ data->known_tasks_addr = MSYMBOL_VALUE_ADDRESS (msym.minsym);
data->known_tasks_length = 1;
sym = lookup_symbol_in_language (KNOWN_TASKS_LIST, NULL, VAR_DOMAIN,
static int
pdc_symbol_addrs (pthdb_user_t user, pthdb_symbol_t *symbols, int count)
{
- struct minimal_symbol *ms;
+ struct bound_minimal_symbol ms;
int i;
char *name;
symbols[i].addr = 0;
else
{
- if (!(ms = lookup_minimal_symbol (name, NULL, NULL)))
+ ms = lookup_minimal_symbol (name, NULL, NULL);
+ if (ms.minsym == NULL)
{
if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, " returning PDC_FAILURE\n");
return PDC_FAILURE;
}
- symbols[i].addr = MSYMBOL_VALUE_ADDRESS (ms);
+ symbols[i].addr = MSYMBOL_VALUE_ADDRESS (ms.minsym);
}
if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, " symbols[%d].addr = %s\n",
{
int status;
char *stub_name;
- struct minimal_symbol *ms;
+ struct bound_minimal_symbol ms;
/* Don't initialize twice. */
if (pd_able)
return;
/* Set a breakpoint on the returned stub function. */
- if (!(ms = lookup_minimal_symbol (stub_name, NULL, NULL)))
+ ms = lookup_minimal_symbol (stub_name, NULL, NULL);
+ if (ms.minsym == NULL)
return;
- pd_brk_addr = MSYMBOL_VALUE_ADDRESS (ms);
+ pd_brk_addr = MSYMBOL_VALUE_ADDRESS (ms.minsym);
if (!create_thread_event_breakpoint (target_gdbarch (), pd_brk_addr))
return;
{
char *target_name;
int target_len = namelen - 2;
- struct minimal_symbol *minsym;
+ struct bound_minimal_symbol minsym;
struct objfile *objfile;
struct obj_section *sec;
sec = find_pc_section (pc);
objfile = (sec == NULL) ? NULL : sec->objfile;
minsym = lookup_minimal_symbol (target_name, NULL, objfile);
- if (minsym != NULL)
- return MSYMBOL_VALUE_ADDRESS (minsym);
+ if (minsym.minsym != NULL)
+ return MSYMBOL_VALUE_ADDRESS (minsym.minsym);
else
return 0;
}
ULONGEST offset,
ULONGEST len, ULONGEST *xfered_len)
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
CORE_ADDR data_address, pointer_address;
struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
size_t ptr_size = TYPE_LENGTH (ptr_type);
size_t block;
msym = lookup_minimal_symbol ("_dl_auxv", NULL, NULL);
- if (msym == NULL)
+ if (msym.minsym == NULL)
return TARGET_XFER_E_IO;
- if (MSYMBOL_SIZE (msym) != ptr_size)
+ if (MSYMBOL_SIZE (msym.minsym) != ptr_size)
return TARGET_XFER_E_IO;
/* POINTER_ADDRESS is a location where the `_dl_auxv' variable
resides. DATA_ADDRESS is the inferior value present in
`_dl_auxv', therefore the real inferior AUXV address. */
- pointer_address = MSYMBOL_VALUE_ADDRESS (msym);
+ pointer_address = MSYMBOL_VALUE_ADDRESS (msym.minsym);
/* The location of the _dl_auxv symbol may no longer be correct if
ld.so runs at a different address than the one present in the
int i;
unsigned short insn;
int scan_stage = 0;
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
unsigned char prologue[AVR_MAX_PROLOGUE_SIZE];
int vpc = 0;
int len;
pc_offset += 2;
msymbol = lookup_minimal_symbol ("__prologue_saves__", NULL, NULL);
- if (!msymbol)
+ if (!msymbol.minsym)
break;
insn = extract_unsigned_integer (&prologue[vpc + 8], 2, byte_order);
/* Resolve offset (in words) from __prologue_saves__ symbol.
Which is a pushes count in `-mcall-prologues' mode */
- num_pushes = AVR_MAX_PUSHES - (i - MSYMBOL_VALUE_ADDRESS (msymbol)) / 2;
+ num_pushes = (AVR_MAX_PUSHES
+ - (i - MSYMBOL_VALUE_ADDRESS (msymbol.minsym)) / 2);
if (num_pushes > AVR_MAX_PUSHES)
{
case LOC_UNRESOLVED:
{
- struct minimal_symbol *msym
+ struct bound_minimal_symbol msym
= lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL);
- if (!msym)
+ if (!msym.minsym)
error (_("Couldn't resolve symbol `%s'."), SYMBOL_PRINT_NAME (var));
/* Push the address of the variable. */
- ax_const_l (ax, MSYMBOL_VALUE_ADDRESS (msym));
+ ax_const_l (ax, MSYMBOL_VALUE_ADDRESS (msym.minsym));
value->kind = axs_lvalue_memory;
}
break;
struct breakpoint_objfile_data
{
/* Minimal symbol for "_ovly_debug_event" (if any). */
- struct minimal_symbol *overlay_msym;
+ struct bound_minimal_symbol overlay_msym;
/* Minimal symbol(s) for "longjmp", "siglongjmp", etc. (if any). */
- struct minimal_symbol *longjmp_msym[NUM_LONGJMP_NAMES];
+ struct bound_minimal_symbol longjmp_msym[NUM_LONGJMP_NAMES];
/* True if we have looked for longjmp probes. */
int longjmp_searched;
VEC (probe_p) *longjmp_probes;
/* Minimal symbol for "std::terminate()" (if any). */
- struct minimal_symbol *terminate_msym;
+ struct bound_minimal_symbol terminate_msym;
/* Minimal symbol for "_Unwind_DebugHook" (if any). */
- struct minimal_symbol *exception_msym;
+ struct bound_minimal_symbol exception_msym;
/* True if we have looked for exception probes. */
int exception_searched;
bp_objfile_data = get_breakpoint_objfile_data (objfile);
- if (msym_not_found_p (bp_objfile_data->overlay_msym))
+ if (msym_not_found_p (bp_objfile_data->overlay_msym.minsym))
continue;
- if (bp_objfile_data->overlay_msym == NULL)
+ if (bp_objfile_data->overlay_msym.minsym == NULL)
{
- struct minimal_symbol *m;
+ struct bound_minimal_symbol m;
m = lookup_minimal_symbol_text (func_name, objfile);
- if (m == NULL)
+ if (m.minsym == NULL)
{
/* Avoid future lookups in this objfile. */
- bp_objfile_data->overlay_msym = &msym_not_found;
+ bp_objfile_data->overlay_msym.minsym = &msym_not_found;
continue;
}
bp_objfile_data->overlay_msym = m;
}
- addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym);
+ addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym.minsym);
b = create_internal_breakpoint (get_objfile_arch (objfile), addr,
bp_overlay_event,
&internal_breakpoint_ops);
const char *func_name;
CORE_ADDR addr;
- if (msym_not_found_p (bp_objfile_data->longjmp_msym[i]))
+ if (msym_not_found_p (bp_objfile_data->longjmp_msym[i].minsym))
continue;
func_name = longjmp_names[i];
- if (bp_objfile_data->longjmp_msym[i] == NULL)
+ if (bp_objfile_data->longjmp_msym[i].minsym == NULL)
{
- struct minimal_symbol *m;
+ struct bound_minimal_symbol m;
m = lookup_minimal_symbol_text (func_name, objfile);
- if (m == NULL)
+ if (m.minsym == NULL)
{
/* Prevent future lookups in this objfile. */
- bp_objfile_data->longjmp_msym[i] = &msym_not_found;
+ bp_objfile_data->longjmp_msym[i].minsym = &msym_not_found;
continue;
}
bp_objfile_data->longjmp_msym[i] = m;
}
- addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->longjmp_msym[i]);
+ addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->longjmp_msym[i].minsym);
b = create_internal_breakpoint (gdbarch, addr, bp_longjmp_master,
&internal_breakpoint_ops);
b->addr_string = xstrdup (func_name);
bp_objfile_data = get_breakpoint_objfile_data (objfile);
- if (msym_not_found_p (bp_objfile_data->terminate_msym))
+ if (msym_not_found_p (bp_objfile_data->terminate_msym.minsym))
continue;
- if (bp_objfile_data->terminate_msym == NULL)
+ if (bp_objfile_data->terminate_msym.minsym == NULL)
{
- struct minimal_symbol *m;
+ struct bound_minimal_symbol m;
m = lookup_minimal_symbol (func_name, NULL, objfile);
- if (m == NULL || (MSYMBOL_TYPE (m) != mst_text
- && MSYMBOL_TYPE (m) != mst_file_text))
+ if (m.minsym == NULL || (MSYMBOL_TYPE (m.minsym) != mst_text
+ && MSYMBOL_TYPE (m.minsym) != mst_file_text))
{
/* Prevent future lookups in this objfile. */
- bp_objfile_data->terminate_msym = &msym_not_found;
+ bp_objfile_data->terminate_msym.minsym = &msym_not_found;
continue;
}
bp_objfile_data->terminate_msym = m;
}
- addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->terminate_msym);
+ addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->terminate_msym.minsym);
b = create_internal_breakpoint (get_objfile_arch (objfile), addr,
bp_std_terminate_master,
&internal_breakpoint_ops);
/* Otherwise, try the hook function. */
- if (msym_not_found_p (bp_objfile_data->exception_msym))
+ if (msym_not_found_p (bp_objfile_data->exception_msym.minsym))
continue;
gdbarch = get_objfile_arch (objfile);
- if (bp_objfile_data->exception_msym == NULL)
+ if (bp_objfile_data->exception_msym.minsym == NULL)
{
- struct minimal_symbol *debug_hook;
+ struct bound_minimal_symbol debug_hook;
debug_hook = lookup_minimal_symbol (func_name, NULL, objfile);
- if (debug_hook == NULL)
+ if (debug_hook.minsym == NULL)
{
- bp_objfile_data->exception_msym = &msym_not_found;
+ bp_objfile_data->exception_msym.minsym = &msym_not_found;
continue;
}
bp_objfile_data->exception_msym = debug_hook;
}
- addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->exception_msym);
+ addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->exception_msym.minsym);
addr = gdbarch_convert_from_func_ptr_addr (gdbarch, addr,
¤t_target);
b = create_internal_breakpoint (gdbarch, addr, bp_exception_master,
static CORE_ADDR
bsd_uthread_lookup_address (const char *name, struct objfile *objfile)
{
- struct minimal_symbol *sym;
+ struct bound_minimal_symbol sym;
sym = lookup_minimal_symbol (name, NULL, objfile);
- if (sym)
- return MSYMBOL_VALUE_ADDRESS (sym);
+ if (sym.minsym)
+ return MSYMBOL_VALUE_ADDRESS (sym.minsym);
return 0;
}
if (sym == NULL
&& parse_language->la_language == language_cplus
&& is_a_field_of_this.type == NULL
- && !lookup_minimal_symbol (copy, NULL, NULL))
+ && lookup_minimal_symbol (copy, NULL, NULL).minsym == NULL)
return UNKNOWN_CPP_NAME;
return NAME;
|| strncmp (name, "_imp_", 5) == 0))
{
const char *name1 = (name[1] == '_' ? &name[7] : &name[6]);
- struct minimal_symbol *found;
+ struct bound_minimal_symbol found;
found = lookup_minimal_symbol (name1, NULL, objfile);
/* If found, there are symbols named "_imp_foo" and "foo"
respectively in OBJFILE. Set the type of symbol "foo"
as 'mst_solib_trampoline'. */
- if (found != NULL && MSYMBOL_TYPE (found) == mst_text)
- MSYMBOL_TYPE (found) = mst_solib_trampoline;
+ if (found.minsym != NULL
+ && MSYMBOL_TYPE (found.minsym) == mst_text)
+ MSYMBOL_TYPE (found.minsym) = mst_solib_trampoline;
}
}
}
if (look_up_one_symbol (symbol_list[i].name, addrp, 1) == 0)
#else
- struct minimal_symbol *sym =
+ struct bound_minimal_symbol sym =
lookup_minimal_symbol (symbol_list[i].name, NULL,
(struct objfile *) arg);
- if (sym != NULL)
- *addrp = MSYMBOL_VALUE_ADDRESS (sym);
+ if (sym.minsym != NULL)
+ *addrp = MSYMBOL_VALUE_ADDRESS (sym.minsym);
else
#endif
{
const char *
d_main_name (void)
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (D_MAIN, NULL, NULL);
- if (msym != NULL)
+ if (msym.minsym != NULL)
return D_MAIN;
/* No known entry procedure found, the main program is probably not D. */
find_stab_function_addr (char *namestring, const char *filename,
struct objfile *objfile)
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
char *p;
int n;
p[n] = 0;
msym = lookup_minimal_symbol (p, filename, objfile);
- if (msym == NULL)
+ if (msym.minsym == NULL)
{
/* Sun Fortran appends an underscore to the minimal symbol name,
try again with an appended underscore if the minimal symbol
msym = lookup_minimal_symbol (p, filename, objfile);
}
- if (msym == NULL && filename != NULL)
+ if (msym.minsym == NULL && filename != NULL)
{
/* Try again without the filename. */
p[n] = 0;
msym = lookup_minimal_symbol (p, NULL, objfile);
}
- if (msym == NULL && filename != NULL)
+ if (msym.minsym == NULL && filename != NULL)
{
/* And try again for Sun Fortran, but without the filename. */
p[n] = '_';
msym = lookup_minimal_symbol (p, NULL, objfile);
}
- return msym == NULL ? 0 : MSYMBOL_VALUE_ADDRESS (msym);
+ return msym.minsym == NULL ? 0 : MSYMBOL_VALUE_ADDRESS (msym.minsym);
}
static void
{
char *p;
int n;
- struct minimal_symbol *minsym;
+ struct bound_minimal_symbol minsym;
p = strchr (last_function_name, ':');
if (p == NULL)
p[n] = 0;
minsym = lookup_minimal_symbol (p, pst->filename, objfile);
- if (minsym == NULL)
+ if (minsym.minsym == NULL)
{
/* Sun Fortran appends an underscore to the minimal symbol name,
try again with an appended underscore if the minimal symbol
minsym = lookup_minimal_symbol (p, pst->filename, objfile);
}
- if (minsym)
- pst->texthigh = MSYMBOL_VALUE_ADDRESS (minsym) + MSYMBOL_SIZE (minsym);
+ if (minsym.minsym)
+ pst->texthigh = (MSYMBOL_VALUE_ADDRESS (minsym.minsym)
+ + MSYMBOL_SIZE (minsym.minsym));
last_function_name = NULL;
}
static void
enable_dec_thread (void)
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
void* caller_context;
int status;
return;
msym = lookup_minimal_symbol ("__pthread_dbg_symtable", NULL, NULL);
- if (msym == NULL)
+ if (msym.minsym == NULL)
{
debug ("enable_dec_thread: No __pthread_dbg_symtable");
return;
}
status = pthreadDebugContextInit (&caller_context, &debug_callbacks,
- (void *) SYMBOL_VALUE_ADDRESS (msym),
+ (void *) SYMBOL_VALUE_ADDRESS (msym.minsym),
&debug_context);
if (status != ESUCCESS)
{
case FIELD_LOC_KIND_PHYSNAME:
{
const char *physname;
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
physname = FIELD_STATIC_PHYSNAME (call_site->target);
/* Handle both the mangled and demangled PHYSNAME. */
msym = lookup_minimal_symbol (physname, NULL, NULL);
- if (msym == NULL)
+ if (msym.minsym == NULL)
{
- msym = lookup_minimal_symbol_by_pc (call_site->pc - 1).minsym;
+ msym = lookup_minimal_symbol_by_pc (call_site->pc - 1);
throw_error (NO_ENTRY_VALUE_ERROR,
_("Cannot find function \"%s\" for a call site target "
"at %s in %s"),
physname, paddress (call_site_gdbarch, call_site->pc),
- msym == NULL ? "???" : MSYMBOL_PRINT_NAME (msym));
+ (msym.minsym == NULL ? "???"
+ : MSYMBOL_PRINT_NAME (msym.minsym)));
}
- return MSYMBOL_VALUE_ADDRESS (msym);
+ return MSYMBOL_VALUE_ADDRESS (msym.minsym);
}
case FIELD_LOC_KIND_PHYSADDR:
CORE_ADDR pointer_address, addr;
asection *plt;
gdb_byte *buf = alloca (ptr_size);
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (name_got_plt, NULL, objfile);
- if (msym == NULL)
+ if (msym.minsym == NULL)
continue;
- if (MSYMBOL_TYPE (msym) != mst_slot_got_plt)
+ if (MSYMBOL_TYPE (msym.minsym) != mst_slot_got_plt)
continue;
- pointer_address = MSYMBOL_VALUE_ADDRESS (msym);
+ pointer_address = MSYMBOL_VALUE_ADDRESS (msym.minsym);
plt = bfd_get_section_by_name (obfd, ".plt");
if (plt == NULL)
continue;
- if (MSYMBOL_SIZE (msym) != ptr_size)
+ if (MSYMBOL_SIZE (msym.minsym) != ptr_size)
continue;
if (target_read_memory (pointer_address, buf, ptr_size) != 0)
continue;
if (value_as_long (target) == 0)
return value_from_longest (long_type, 0);
- if (lookup_minimal_symbol ("objc_msg_lookup", 0, 0))
+ if (lookup_minimal_symbol ("objc_msg_lookup", 0, 0).minsym)
gnu_runtime = 1;
/* Find the method dispatch (Apple runtime) or method lookup
/* The field where the callback should store the minimal symbol
if found. It should be initialized to NULL before the search
is started. */
- struct minimal_symbol *result;
-
- /* The objfile in which the symbol was found. */
- struct objfile *objfile;
+ struct bound_minimal_symbol result;
};
/* A callback function for gdbarch_iterate_over_objfiles_in_search_order.
{
struct minsym_lookup_data *data = (struct minsym_lookup_data *) cb_data;
- gdb_assert (data->result == NULL);
+ gdb_assert (data->result.minsym == NULL);
data->result = lookup_minimal_symbol (data->name, NULL, objfile);
- data->objfile = objfile;
/* The iterator should stop iff a match was found. */
- return (data->result != NULL);
+ return (data->result.minsym != NULL);
}
/* A default implementation for the "la_read_var_value" hook in
(get_objfile_arch (SYMBOL_SYMTAB (var)->objfile),
minsym_lookup_iterator_cb, &lookup_data,
SYMBOL_SYMTAB (var)->objfile);
- msym = lookup_data.result;
+ msym = lookup_data.result.minsym;
if (msym == NULL)
error (_("No global symbol \"%s\"."), SYMBOL_LINKAGE_NAME (var));
if (overlay_debugging)
addr = symbol_overlayed_address (MSYMBOL_VALUE_ADDRESS (msym),
- MSYMBOL_OBJ_SECTION (lookup_data.objfile,
+ MSYMBOL_OBJ_SECTION (lookup_data.result.objfile,
msym));
else
addr = MSYMBOL_VALUE_ADDRESS (msym);
- obj_section = MSYMBOL_OBJ_SECTION (lookup_data.objfile, msym);
+ obj_section = MSYMBOL_OBJ_SECTION (lookup_data.result.objfile, msym);
if (obj_section
&& (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
addr = target_translate_tls_address (obj_section->objfile, addr);
static int
inside_main_func (struct frame_info *this_frame)
{
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
CORE_ADDR maddr;
if (symfile_objfile == 0)
return 0;
msymbol = lookup_minimal_symbol (main_name (), NULL, symfile_objfile);
- if (msymbol == NULL)
+ if (msymbol.minsym == NULL)
return 0;
/* Make certain that the code, and not descriptor, address is
returned. */
maddr = gdbarch_convert_from_func_ptr_addr (get_frame_arch (this_frame),
- MSYMBOL_VALUE_ADDRESS (msymbol),
+ MSYMBOL_VALUE_ADDRESS (msymbol.minsym),
¤t_target);
return maddr == get_frame_func (this_frame);
}
= frv_frame_unwind_cache (this_frame, this_prologue_cache);
CORE_ADDR base;
CORE_ADDR func;
- struct minimal_symbol *msym_stack;
+ struct bound_minimal_symbol msym_stack;
struct frame_id id;
/* The FUNC is easy. */
/* Check if the stack is empty. */
msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL);
- if (msym_stack && info->base == MSYMBOL_VALUE_ADDRESS (msym_stack))
+ if (msym_stack.minsym
+ && info->base == MSYMBOL_VALUE_ADDRESS (msym_stack.minsym))
return;
/* Hopefully the prologue analysis either correctly determined the
struct value *sbrk_fn, *ret;
bfd_vma tmp;
- if (lookup_minimal_symbol ("sbrk", NULL, NULL) != NULL)
+ if (lookup_minimal_symbol ("sbrk", NULL, NULL).minsym != NULL)
{
sbrk_fn = find_function_in_inferior ("sbrk", &sbrk_objf);
if (sbrk_fn == NULL)
return (bfd_vma) 0;
}
- else if (lookup_minimal_symbol ("_sbrk", NULL, NULL) != NULL)
+ else if (lookup_minimal_symbol ("_sbrk", NULL, NULL).minsym != NULL)
{
sbrk_fn = find_function_in_inferior ("_sbrk", &sbrk_objf);
if (sbrk_fn == NULL)
if (resolver.minsym)
{
/* The dynamic linker began using this name in early 2005. */
- struct minimal_symbol *fixup
+ struct bound_minimal_symbol fixup
= lookup_minimal_symbol ("_dl_fixup", NULL, resolver.objfile);
/* This is the name used in older versions. */
- if (! fixup)
+ if (! fixup.minsym)
fixup = lookup_minimal_symbol ("fixup", NULL, resolver.objfile);
- if (fixup && MSYMBOL_VALUE_ADDRESS (fixup) == pc)
+ if (fixup.minsym && MSYMBOL_VALUE_ADDRESS (fixup.minsym) == pc)
return frame_unwind_caller_pc (get_current_frame ());
}
else
{
char *sym_name;
- struct minimal_symbol *minsym;
+ struct bound_minimal_symbol minsym;
sym_name = concat ("typeinfo for ", typename, (char *) NULL);
make_cleanup (xfree, sym_name);
minsym = lookup_minimal_symbol (sym_name, NULL, NULL);
- if (minsym == NULL)
+ if (minsym.minsym == NULL)
error (_("could not find typeinfo symbol for '%s'"), typename);
- result = value_at_lazy (typeinfo_type, MSYMBOL_VALUE_ADDRESS (minsym));
+ result = value_at_lazy (typeinfo_type,
+ MSYMBOL_VALUE_ADDRESS (minsym.minsym));
}
do_cleanups (cleanup);
{
CORE_ADDR real_stop_pc, method_stop_pc, func_addr;
struct gdbarch *gdbarch = get_frame_arch (frame);
- struct minimal_symbol *thunk_sym, *fn_sym;
+ struct bound_minimal_symbol thunk_sym, fn_sym;
struct obj_section *section;
const char *thunk_name, *fn_name;
real_stop_pc = stop_pc;
/* Find the linker symbol for this potential thunk. */
- thunk_sym = lookup_minimal_symbol_by_pc (real_stop_pc).minsym;
+ thunk_sym = lookup_minimal_symbol_by_pc (real_stop_pc);
section = find_pc_section (real_stop_pc);
- if (thunk_sym == NULL || section == NULL)
+ if (thunk_sym.minsym == NULL || section == NULL)
return 0;
/* The symbol's demangled name should be something like "virtual
thunk to FUNCTION", where FUNCTION is the name of the function
being thunked to. */
- thunk_name = MSYMBOL_DEMANGLED_NAME (thunk_sym);
+ thunk_name = MSYMBOL_DEMANGLED_NAME (thunk_sym.minsym);
if (thunk_name == NULL || strstr (thunk_name, " thunk to ") == NULL)
return 0;
fn_name = strstr (thunk_name, " thunk to ") + strlen (" thunk to ");
fn_sym = lookup_minimal_symbol (fn_name, NULL, section->objfile);
- if (fn_sym == NULL)
+ if (fn_sym.minsym == NULL)
return 0;
- method_stop_pc = MSYMBOL_VALUE_ADDRESS (fn_sym);
+ method_stop_pc = MSYMBOL_VALUE_ADDRESS (fn_sym.minsym);
/* Some targets have minimal symbols pointing to function descriptors
(powerpc 64 for example). Make sure to retrieve the address
const char *
go_main_name (void)
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (GO_MAIN_MAIN, NULL, NULL);
- if (msym != NULL)
+ if (msym.minsym != NULL)
return GO_MAIN_MAIN;
/* No known entry procedure found, the main program is probably not Go. */
(curr_inst == 0xeaa0d002))
{
struct bound_minimal_symbol stubsym;
- struct minimal_symbol *libsym;
+ struct bound_minimal_symbol libsym;
stubsym = lookup_minimal_symbol_by_pc (loc);
if (stubsym.minsym == NULL)
libsym = lookup_minimal_symbol (MSYMBOL_LINKAGE_NAME (stubsym.minsym),
NULL, NULL);
- if (libsym == NULL)
+ if (libsym.minsym == NULL)
{
warning (_("Unable to find library symbol for %s."),
MSYMBOL_PRINT_NAME (stubsym.minsym));
return orig_pc == pc ? 0 : pc & ~0x3;
}
- return MSYMBOL_VALUE (libsym);
+ return MSYMBOL_VALUE (libsym.minsym);
}
/* Does it look like bl X,%rp or bl X,%r0? Another way to do a
{
struct objfile *objfile;
struct bound_minimal_symbol funsym;
- struct minimal_symbol *stubsym;
+ struct bound_minimal_symbol stubsym;
CORE_ADDR stubaddr;
funsym = lookup_minimal_symbol_by_pc (funcaddr);
stubsym = lookup_minimal_symbol_solib_trampoline
(MSYMBOL_LINKAGE_NAME (funsym.minsym), objfile);
- if (stubsym)
+ if (stubsym.minsym)
{
struct unwind_table_entry *u;
- u = find_unwind_entry (MSYMBOL_VALUE (stubsym));
+ u = find_unwind_entry (MSYMBOL_VALUE (stubsym.minsym));
if (u == NULL
|| (u->stub_unwind.stub_type != IMPORT
&& u->stub_unwind.stub_type != IMPORT_SHLIB))
continue;
- stubaddr = MSYMBOL_VALUE (stubsym);
+ stubaddr = MSYMBOL_VALUE (stubsym.minsym);
/* If we found an IMPORT stub, then we can stop searching;
if we found an IMPORT_SHLIB, we want to continue the search
CORE_ADDR
hppa_symbol_address(const char *sym)
{
- struct minimal_symbol *minsym;
+ struct bound_minimal_symbol minsym;
minsym = lookup_minimal_symbol (sym, NULL, NULL);
- if (minsym)
- return MSYMBOL_VALUE_ADDRESS (minsym);
+ if (minsym.minsym)
+ return MSYMBOL_VALUE_ADDRESS (minsym.minsym);
else
return (CORE_ADDR)-1;
}
/* Return the minimal symbol whose name is NAME and stub type is STUB_TYPE.
Return NULL if no such symbol was found. */
-struct minimal_symbol *
+struct bound_minimal_symbol
hppa_lookup_stub_minimal_symbol (const char *name,
enum unwind_stub_types stub_type)
{
struct objfile *objfile;
struct minimal_symbol *msym;
+ struct bound_minimal_symbol result = { NULL, NULL };
ALL_MSYMBOLS (objfile, msym)
{
u = find_unwind_entry (MSYMBOL_VALUE (msym));
if (u != NULL && u->stub_unwind.stub_type == stub_type)
- return msym;
+ {
+ result.objfile = objfile;
+ result.minsym = msym;
+ return result;
+ }
}
}
- return NULL;
+ return result;
}
static void
extern CORE_ADDR hppa_unwind_pc (struct gdbarch *gdbarch,
struct frame_info *next_frame);
-extern struct minimal_symbol *
+extern struct bound_minimal_symbol
hppa_lookup_stub_minimal_symbol (const char *name,
enum unwind_stub_types stub_type);
struct jit_program_space_data *ps_data)
{
struct bound_minimal_symbol reg_symbol;
- struct minimal_symbol *desc_symbol;
+ struct bound_minimal_symbol desc_symbol;
struct jit_objfile_data *objf_data;
CORE_ADDR addr;
desc_symbol = lookup_minimal_symbol (jit_descriptor_name, NULL,
reg_symbol.objfile);
- if (desc_symbol == NULL || MSYMBOL_VALUE_ADDRESS (desc_symbol) == 0)
+ if (desc_symbol.minsym == NULL
+ || MSYMBOL_VALUE_ADDRESS (desc_symbol.minsym) == 0)
return 1;
objf_data = get_jit_objfile_data (reg_symbol.objfile);
objf_data->register_code = reg_symbol.minsym;
- objf_data->descriptor = desc_symbol;
+ objf_data->descriptor = desc_symbol.minsym;
ps_data->objfile = reg_symbol.objfile;
}
old_cleanup = make_cleanup (inferior_call_waitpid_cleanup, oldfp);
/* Get the waitpid_fn. */
- if (lookup_minimal_symbol ("waitpid", NULL, NULL) != NULL)
+ if (lookup_minimal_symbol ("waitpid", NULL, NULL).minsym != NULL)
waitpid_fn = find_function_in_inferior ("waitpid", &waitpid_objf);
- if (!waitpid_fn && lookup_minimal_symbol ("_waitpid", NULL, NULL) != NULL)
+ if (!waitpid_fn
+ && lookup_minimal_symbol ("_waitpid", NULL, NULL).minsym != NULL)
waitpid_fn = find_function_in_inferior ("_waitpid", &waitpid_objf);
if (!waitpid_fn)
goto out;
/* Make the inferior fork, record its (and gdb's) state. */
- if (lookup_minimal_symbol ("fork", NULL, NULL) != NULL)
+ if (lookup_minimal_symbol ("fork", NULL, NULL).minsym != NULL)
fork_fn = find_function_in_inferior ("fork", &fork_objf);
if (!fork_fn)
- if (lookup_minimal_symbol ("_fork", NULL, NULL) != NULL)
+ if (lookup_minimal_symbol ("_fork", NULL, NULL).minsym != NULL)
fork_fn = find_function_in_inferior ("fork", &fork_objf);
if (!fork_fn)
error (_("checkpoint: can't find fork function in inferior."));
static int
get_signo (const char *name)
{
- struct minimal_symbol *ms;
+ struct bound_minimal_symbol ms;
int signo;
ms = lookup_minimal_symbol (name, NULL, NULL);
- if (ms == NULL)
+ if (ms.minsym == NULL)
return 0;
- if (target_read_memory (MSYMBOL_VALUE_ADDRESS (ms), (gdb_byte *) &signo,
+ if (target_read_memory (MSYMBOL_VALUE_ADDRESS (ms.minsym),
+ (gdb_byte *) &signo,
sizeof (signo)) != 0)
return 0;
static int
inferior_has_bug (const char *ver_symbol, int ver_major_min, int ver_minor_min)
{
- struct minimal_symbol *version_msym;
+ struct bound_minimal_symbol version_msym;
CORE_ADDR version_addr;
char *version;
int err, got, retval = 0;
version_msym = lookup_minimal_symbol (ver_symbol, NULL, NULL);
- if (version_msym == NULL)
+ if (version_msym.minsym == NULL)
return 0;
- version_addr = MSYMBOL_VALUE_ADDRESS (version_msym);
+ version_addr = MSYMBOL_VALUE_ADDRESS (version_msym.minsym);
got = target_read_string (version_addr, &version, 32, &err);
if (err == 0 && memchr (version, 0, got) == &version[got -1])
{
/* Everything else is passed in mem0, using as many bytes as
needed. This is not what the Renesas tools do, but it's
what GCC does at the moment. */
- struct minimal_symbol *mem0
+ struct bound_minimal_symbol mem0
= lookup_minimal_symbol ("mem0", NULL, NULL);
- if (! mem0)
+ if (! mem0.minsym)
error (_("The return value is stored in memory at 'mem0', "
"but GDB cannot find\n"
"its address."));
- read_memory (MSYMBOL_VALUE_ADDRESS (mem0), readbuf, valtype_len);
+ read_memory (MSYMBOL_VALUE_ADDRESS (mem0.minsym), readbuf,
+ valtype_len);
}
}
/* Everything else is passed in mem0, using as many bytes as
needed. This is not what the Renesas tools do, but it's
what GCC does at the moment. */
- struct minimal_symbol *mem0
+ struct bound_minimal_symbol mem0
= lookup_minimal_symbol ("mem0", NULL, NULL);
- if (! mem0)
+ if (! mem0.minsym)
error (_("The return value is stored in memory at 'mem0', "
"but GDB cannot find\n"
" its address."));
- write_memory (MSYMBOL_VALUE_ADDRESS (mem0), writebuf, valtype_len);
+ write_memory (MSYMBOL_VALUE_ADDRESS (mem0.minsym), writebuf,
+ valtype_len);
}
}
{
const char *func_name;
char *tramp_name;
- struct minimal_symbol *tramp_msym;
+ struct bound_minimal_symbol tramp_msym;
/* Try to find a linker symbol at this address. */
struct bound_minimal_symbol func_msym
the name any more. */
xfree (tramp_name);
- if (! tramp_msym)
+ if (! tramp_msym.minsym)
{
CORE_ADDR ptrval;
else
{
/* The trampoline's address is our pointer. */
- addr = MSYMBOL_VALUE_ADDRESS (tramp_msym);
+ addr = MSYMBOL_VALUE_ADDRESS (tramp_msym.minsym);
}
}
if (len > 4
&& strcmp (ptr_msym_name + len - 4, ".plt") == 0)
{
- struct minimal_symbol *func_msym;
+ struct bound_minimal_symbol func_msym;
/* We have a .plt symbol; try to find the symbol for the
corresponding function.
/* If we do have such a symbol, return its value as the
function's true address. */
- if (func_msym)
- ptr = MSYMBOL_VALUE_ADDRESS (func_msym);
+ if (func_msym.minsym)
+ ptr = MSYMBOL_VALUE_ADDRESS (func_msym.minsym);
}
}
else
= m32r_frame_unwind_cache (this_frame, this_prologue_cache);
CORE_ADDR base;
CORE_ADDR func;
- struct minimal_symbol *msym_stack;
+ struct bound_minimal_symbol msym_stack;
struct frame_id id;
/* The FUNC is easy. */
/* Check if the stack is empty. */
msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL);
- if (msym_stack && info->base == MSYMBOL_VALUE_ADDRESS (msym_stack))
+ if (msym_stack.minsym
+ && info->base == MSYMBOL_VALUE_ADDRESS (msym_stack.minsym))
return;
/* Hopefully the prologue analysis either correctly determined the
static void
m68hc11_get_register_info (struct m68hc11_soft_reg *reg, const char *name)
{
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
msymbol = lookup_minimal_symbol (name, NULL, NULL);
- if (msymbol)
+ if (msymbol.minsym)
{
- reg->addr = MSYMBOL_VALUE_ADDRESS (msymbol);
+ reg->addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
reg->name = xstrdup (name);
/* Keep track of the address range for soft registers. */
macho_resolve_oso_sym_with_minsym (struct objfile *main_objfile, asymbol *sym)
{
/* For common symbol and global symbols, use the min symtab. */
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
const char *name = sym->name;
if (name[0] == bfd_get_symbol_leading_char (main_objfile->obfd))
++name;
msym = lookup_minimal_symbol (name, NULL, main_objfile);
- if (msym == NULL)
+ if (msym.minsym == NULL)
{
warning (_("can't find symbol '%s' in minsymtab"), name);
return 0;
}
else
- return MSYMBOL_VALUE_ADDRESS (msym);
+ return MSYMBOL_VALUE_ADDRESS (msym.minsym);
}
/* Add oso file OSO/ABFD as a symbol file. */
Obviously, there must be distinct mangled names for each of these,
but the demangled names are all the same: S::S or S::~S. */
-static struct bound_minimal_symbol
-lookup_minimal_symbol_internal (const char *name, const char *sfile,
- struct objfile *objf)
+struct bound_minimal_symbol
+lookup_minimal_symbol (const char *name, const char *sfile,
+ struct objfile *objf)
{
struct objfile *objfile;
struct bound_minimal_symbol found_symbol = { NULL, NULL };
/* See minsyms.h. */
-struct minimal_symbol *
-lookup_minimal_symbol (const char *name, const char *sfile,
- struct objfile *objf)
-{
- struct bound_minimal_symbol bms = lookup_minimal_symbol_internal (name,
- sfile,
- objf);
-
- return bms.minsym;
-}
-
-/* See minsyms.h. */
-
struct bound_minimal_symbol
lookup_bound_minimal_symbol (const char *name)
{
- return lookup_minimal_symbol_internal (name, NULL, NULL);
+ return lookup_minimal_symbol (name, NULL, NULL);
}
/* See minsyms.h. */
/* See minsyms.h. */
-struct minimal_symbol *
+struct bound_minimal_symbol
lookup_minimal_symbol_text (const char *name, struct objfile *objf)
{
struct objfile *objfile;
struct minimal_symbol *msymbol;
- struct minimal_symbol *found_symbol = NULL;
- struct minimal_symbol *found_file_symbol = NULL;
+ struct bound_minimal_symbol found_symbol = { NULL, NULL };
+ struct bound_minimal_symbol found_file_symbol = { NULL, NULL };
unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE;
for (objfile = object_files;
- objfile != NULL && found_symbol == NULL;
+ objfile != NULL && found_symbol.minsym == NULL;
objfile = objfile->next)
{
if (objf == NULL || objf == objfile
|| objf == objfile->separate_debug_objfile_backlink)
{
for (msymbol = objfile->msymbol_hash[hash];
- msymbol != NULL && found_symbol == NULL;
+ msymbol != NULL && found_symbol.minsym == NULL;
msymbol = msymbol->hash_next)
{
if (strcmp (MSYMBOL_LINKAGE_NAME (msymbol), name) == 0 &&
switch (MSYMBOL_TYPE (msymbol))
{
case mst_file_text:
- found_file_symbol = msymbol;
+ found_file_symbol.minsym = msymbol;
+ found_file_symbol.objfile = objfile;
break;
default:
- found_symbol = msymbol;
+ found_symbol.minsym = msymbol;
+ found_symbol.objfile = objfile;
break;
}
}
}
}
/* External symbols are best. */
- if (found_symbol)
+ if (found_symbol.minsym)
return found_symbol;
/* File-local symbols are next best. */
- if (found_file_symbol)
- return found_file_symbol;
-
- return NULL;
+ return found_file_symbol;
}
/* See minsyms.h. */
/* See minsyms.h. */
-struct minimal_symbol *
+struct bound_minimal_symbol
lookup_minimal_symbol_solib_trampoline (const char *name,
struct objfile *objf)
{
struct objfile *objfile;
struct minimal_symbol *msymbol;
- struct minimal_symbol *found_symbol = NULL;
+ struct bound_minimal_symbol found_symbol = { NULL, NULL };
unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE;
for (objfile = object_files;
- objfile != NULL && found_symbol == NULL;
+ objfile != NULL;
objfile = objfile->next)
{
if (objf == NULL || objf == objfile
|| objf == objfile->separate_debug_objfile_backlink)
{
for (msymbol = objfile->msymbol_hash[hash];
- msymbol != NULL && found_symbol == NULL;
+ msymbol != NULL;
msymbol = msymbol->hash_next)
{
if (strcmp (MSYMBOL_LINKAGE_NAME (msymbol), name) == 0 &&
MSYMBOL_TYPE (msymbol) == mst_solib_trampoline)
- return msymbol;
+ {
+ found_symbol.objfile = objfile;
+ found_symbol.minsym = msymbol;
+ return found_symbol;
+ }
}
}
}
- return NULL;
+ return found_symbol;
}
/* Search through the minimal symbol table for each objfile and find
/* Look through all the current minimal symbol tables and find the
first minimal symbol that matches NAME. If OBJF is non-NULL, limit
- the search to that objfile. If SFILE is non-NULL, the only file-scope
- symbols considered will be from that source file (global symbols are
- still preferred). Returns a pointer to the minimal symbol that
- matches, or NULL if no match is found. */
+ the search to that objfile. If SFILE is non-NULL, the only
+ file-scope symbols considered will be from that source file (global
+ symbols are still preferred). Returns a bound minimal symbol that
+ matches, or an empty bound minimal symbol if no match is found. */
-struct minimal_symbol *lookup_minimal_symbol (const char *,
- const char *,
- struct objfile *);
+struct bound_minimal_symbol lookup_minimal_symbol (const char *,
+ const char *,
+ struct objfile *);
-/* Like lookup_minimal_symbol, but searches all files and objfiles
- and returns a bound minimal symbol. */
+/* Like lookup_minimal_symbol, but searches all files and
+ objfiles. */
struct bound_minimal_symbol lookup_bound_minimal_symbol (const char *);
/* Look through all the current minimal symbol tables and find the
first minimal symbol that matches NAME and has text type. If OBJF
- is non-NULL, limit the search to that objfile. Returns a pointer
- to the minimal symbol that matches, or NULL if no match is found.
+ is non-NULL, limit the search to that objfile. Returns a bound
+ minimal symbol that matches, or an "empty" bound minimal symbol
+ otherwise.
This function only searches the mangled (linkage) names. */
-struct minimal_symbol *lookup_minimal_symbol_text (const char *,
- struct objfile *);
+struct bound_minimal_symbol lookup_minimal_symbol_text (const char *,
+ struct objfile *);
/* Look through all the current minimal symbol tables and find the
first minimal symbol that matches NAME and is a solib trampoline.
This function only searches the mangled (linkage) names. */
-struct minimal_symbol *lookup_minimal_symbol_solib_trampoline
+struct bound_minimal_symbol lookup_minimal_symbol_solib_trampoline
(const char *,
struct objfile *);
static CORE_ADDR
mips_linux_skip_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{
- struct minimal_symbol *resolver;
+ struct bound_minimal_symbol resolver;
resolver = lookup_minimal_symbol ("__dl_runtime_resolve", NULL, NULL);
- if (resolver && MSYMBOL_VALUE_ADDRESS (resolver) == pc)
+ if (resolver.minsym && MSYMBOL_VALUE_ADDRESS (resolver.minsym) == pc)
return frame_unwind_caller_pc (get_current_frame ());
return glibc_skip_solib_resolver (gdbarch, pc);
return 0;
}
- if (lookup_minimal_symbol("objc_lookUpClass", 0, 0))
+ if (lookup_minimal_symbol("objc_lookUpClass", 0, 0).minsym)
function = find_function_in_inferior("objc_lookUpClass", NULL);
- else if (lookup_minimal_symbol ("objc_lookup_class", 0, 0))
+ else if (lookup_minimal_symbol ("objc_lookup_class", 0, 0).minsym)
function = find_function_in_inferior("objc_lookup_class", NULL);
else
{
return 0;
}
- if (lookup_minimal_symbol("sel_getUid", 0, 0))
+ if (lookup_minimal_symbol("sel_getUid", 0, 0).minsym)
function = find_function_in_inferior("sel_getUid", NULL);
- else if (lookup_minimal_symbol ("sel_get_any_uid", 0, 0))
+ else if (lookup_minimal_symbol ("sel_get_any_uid", 0, 0).minsym)
function = find_function_in_inferior("sel_get_any_uid", NULL);
else
{
stringValue[2] = value_string(ptr, len, char_type);
stringValue[2] = value_coerce_array(stringValue[2]);
/* _NSNewStringFromCString replaces "istr" after Lantern2A. */
- if (lookup_minimal_symbol("_NSNewStringFromCString", 0, 0))
+ if (lookup_minimal_symbol("_NSNewStringFromCString", 0, 0).minsym)
{
function = find_function_in_inferior("_NSNewStringFromCString", NULL);
nsstringValue = call_function_by_hand(function, 1, &stringValue[2]);
}
- else if (lookup_minimal_symbol("istr", 0, 0))
+ else if (lookup_minimal_symbol("istr", 0, 0).minsym)
{
function = find_function_in_inferior("istr", NULL);
nsstringValue = call_function_by_hand(function, 1, &stringValue[2]);
}
- else if (lookup_minimal_symbol("+[NSString stringWithCString:]", 0, 0))
+ else if (lookup_minimal_symbol("+[NSString stringWithCString:]", 0, 0).minsym)
{
function
= find_function_in_inferior("+[NSString stringWithCString:]", NULL);
SYMBOL_NATURAL_NAME (sym));
else
{
- struct minimal_symbol *msym = lookup_minimal_symbol (selector, 0, 0);
+ struct bound_minimal_symbol msym
+ = lookup_minimal_symbol (selector, 0, 0);
- if (msym != NULL)
+ if (msym.minsym != NULL)
VEC_safe_push (const_char_ptr, *symbol_names,
- MSYMBOL_NATURAL_NAME (msym));
+ MSYMBOL_NATURAL_NAME (msym.minsym));
}
}
CORE_ADDR
obsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol("_dl_bind", NULL, NULL);
- if (msym && MSYMBOL_VALUE_ADDRESS (msym) == pc)
+ if (msym.minsym && MSYMBOL_VALUE_ADDRESS (msym.minsym) == pc)
return frame_unwind_caller_pc (get_current_frame ());
else
return find_solib_trampoline_target (get_current_frame (), pc);
const char *
pascal_main_name (void)
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (GPC_P_INITIALIZE, NULL, NULL);
/* If '_p_initialize' was not found, the main program is likely not
written in Pascal. */
- if (msym == NULL)
+ if (msym.minsym == NULL)
return NULL;
msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_1, NULL, NULL);
- if (msym != NULL)
+ if (msym.minsym != NULL)
{
return GPC_MAIN_PROGRAM_NAME_1;
}
msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_2, NULL, NULL);
- if (msym != NULL)
+ if (msym.minsym != NULL)
{
return GPC_MAIN_PROGRAM_NAME_2;
}
static void
ppc_linux_spe_context_lookup (struct objfile *objfile)
{
- struct minimal_symbol *sym;
+ struct bound_minimal_symbol sym;
if (!objfile)
{
}
sym = lookup_minimal_symbol ("__spe_current_active_context", NULL, objfile);
- if (sym)
+ if (sym.minsym)
{
spe_context_objfile = objfile;
spe_context_lm_addr = svr4_fetch_objfile_link_map (objfile);
- spe_context_offset = MSYMBOL_VALUE_ADDRESS (sym);
+ spe_context_offset = MSYMBOL_VALUE_ADDRESS (sym.minsym);
spe_context_cache_ptid = minus_one_ptid;
spe_context_cache_address = 0;
return;
{
struct obj_section *dot_fn_section;
struct bound_minimal_symbol dot_fn;
- struct minimal_symbol *fn;
+ struct bound_minimal_symbol fn;
/* Find the minimal symbol that corresponds to CODE_ADDR (should
have a name of the form ".FN"). */
contain a minimal symbol with the same name. */
fn = lookup_minimal_symbol (MSYMBOL_LINKAGE_NAME (dot_fn.minsym) + 1, NULL,
dot_fn_section->objfile);
- if (fn == NULL)
+ if (fn.minsym == NULL)
return 0;
/* Found a descriptor. */
- (*desc_addr) = MSYMBOL_VALUE_ADDRESS (fn);
+ (*desc_addr) = MSYMBOL_VALUE_ADDRESS (fn.minsym);
return 1;
}
ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj,
const char *name, psaddr_t *sym_addr)
{
- struct minimal_symbol *ms;
+ struct bound_minimal_symbol ms;
struct cleanup *old_chain = save_current_program_space ();
struct inferior *inf = find_inferior_pid (ptid_get_pid (ph->ptid));
ps_err_e result;
/* FIXME: kettenis/2000-09-03: What should we do with OBJ? */
ms = lookup_minimal_symbol (name, NULL, NULL);
- if (ms == NULL)
+ if (ms.minsym == NULL)
result = PS_NOSYM;
else
{
- *sym_addr = core_addr_to_ps_addr (MSYMBOL_VALUE_ADDRESS (ms));
+ *sym_addr = core_addr_to_ps_addr (MSYMBOL_VALUE_ADDRESS (ms.minsym));
result = PS_OK;
}
and return its associated minimal symbol.
Return NULL if not found. */
-static struct minimal_symbol *
+static struct bound_minimal_symbol
get_running_thread_msymbol (void)
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (running_thread_name, NULL, NULL);
- if (!msym)
+ if (!msym.minsym)
/* Older versions of the GNAT runtime were using a different
(less ideal) name for the symbol where the active thread ID
is stored. If we couldn't find the symbol using the latest
static int
has_ravenscar_runtime (void)
{
- struct minimal_symbol *msym_ravenscar_runtime_initializer =
+ struct bound_minimal_symbol msym_ravenscar_runtime_initializer =
lookup_minimal_symbol (ravenscar_runtime_initializer, NULL, NULL);
- struct minimal_symbol *msym_known_tasks =
+ struct bound_minimal_symbol msym_known_tasks =
lookup_minimal_symbol (known_tasks_name, NULL, NULL);
- struct minimal_symbol *msym_first_task =
+ struct bound_minimal_symbol msym_first_task =
lookup_minimal_symbol (first_task_name, NULL, NULL);
- struct minimal_symbol *msym_running_thread = get_running_thread_msymbol ();
+ struct bound_minimal_symbol msym_running_thread
+ = get_running_thread_msymbol ();
- return (msym_ravenscar_runtime_initializer
- && (msym_known_tasks || msym_first_task)
- && msym_running_thread);
+ return (msym_ravenscar_runtime_initializer.minsym
+ && (msym_known_tasks.minsym || msym_first_task.minsym)
+ && msym_running_thread.minsym);
}
/* Return True if the Ada Ravenscar run-time can be found in the
static CORE_ADDR
get_running_thread_id (void)
{
- const struct minimal_symbol *object_msym = get_running_thread_msymbol ();
+ struct bound_minimal_symbol object_msym = get_running_thread_msymbol ();
int object_size;
int buf_size;
gdb_byte *buf;
struct type *builtin_type_void_data_ptr =
builtin_type (target_gdbarch ())->builtin_data_ptr;
- if (!object_msym)
+ if (!object_msym.minsym)
return 0;
- object_addr = MSYMBOL_VALUE_ADDRESS (object_msym);
+ object_addr = MSYMBOL_VALUE_ADDRESS (object_msym.minsym);
object_size = TYPE_LENGTH (builtin_type_void_data_ptr);
buf_size = object_size;
buf = alloca (buf_size);
{
struct remote_state *rs = get_remote_state ();
char *msg, *reply, *tmp;
- struct minimal_symbol *sym;
+ struct bound_minimal_symbol sym;
int end;
/* The remote side has no concept of inferiors that aren't running
end = hex2bin (tmp, (gdb_byte *) msg, strlen (tmp) / 2);
msg[end] = '\0';
sym = lookup_minimal_symbol (msg, NULL, NULL);
- if (sym == NULL)
+ if (sym.minsym == NULL)
xsnprintf (msg, get_remote_packet_size (), "qSymbol::%s", &reply[8]);
else
{
int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
- CORE_ADDR sym_addr = MSYMBOL_VALUE_ADDRESS (sym);
+ CORE_ADDR sym_addr = MSYMBOL_VALUE_ADDRESS (sym.minsym);
/* If this is a function address, return the start of code
instead of any data function descriptor. */
ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *ld_object_name,
const char *ld_symbol_name, gdb_ps_addr_t *ld_symbol_addr)
{
- struct minimal_symbol *ms;
+ struct bound_minimal_symbol ms;
ms = lookup_minimal_symbol (ld_symbol_name, NULL, NULL);
- if (!ms)
+ if (!ms.minsym)
return PS_NOSYM;
- *ld_symbol_addr = SYMBOL_VALUE_ADDRESS (ms);
+ *ld_symbol_addr = SYMBOL_VALUE_ADDRESS (ms.minsym);
return PS_OK;
}
CORE_ADDR
sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol("elf_bndr", NULL, NULL);
- if (msym && MSYMBOL_VALUE_ADDRESS (msym) == pc)
+ if (msym.minsym && MSYMBOL_VALUE_ADDRESS (msym.minsym) == pc)
return frame_unwind_caller_pc (get_current_frame ());
return 0;
lm_base (void)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
- struct minimal_symbol *got_sym;
+ struct bound_minimal_symbol got_sym;
CORE_ADDR addr;
gdb_byte buf[TIC6X_PTR_SIZE];
struct dsbt_info *info = get_dsbt_info ();
got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL,
symfile_objfile);
- if (got_sym != 0)
+ if (got_sym.minsym != 0)
{
- addr = MSYMBOL_VALUE_ADDRESS (got_sym);
+ addr = MSYMBOL_VALUE_ADDRESS (got_sym.minsym);
if (solib_dsbt_debug)
fprintf_unfiltered (gdb_stdlog,
"lm_base: get addr %x by _GLOBAL_OFFSET_TABLE_.\n",
lm_base (void)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
- struct minimal_symbol *got_sym;
+ struct bound_minimal_symbol got_sym;
CORE_ADDR addr;
gdb_byte buf[FRV_PTR_SIZE];
got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL,
symfile_objfile);
- if (got_sym == 0)
+ if (got_sym.minsym == 0)
{
if (solib_frv_debug)
fprintf_unfiltered (gdb_stdlog,
return 0;
}
- addr = MSYMBOL_VALUE_ADDRESS (got_sym) + 8;
+ addr = MSYMBOL_VALUE_ADDRESS (got_sym.minsym) + 8;
if (solib_frv_debug)
fprintf_unfiltered (gdb_stdlog,
static CORE_ADDR
main_got (void)
{
- struct minimal_symbol *got_sym;
+ struct bound_minimal_symbol got_sym;
got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_",
NULL, symfile_objfile);
- if (got_sym == 0)
+ if (got_sym.minsym == 0)
return 0;
- return MSYMBOL_VALUE_ADDRESS (got_sym);
+ return MSYMBOL_VALUE_ADDRESS (got_sym.minsym);
}
/* Find the global pointer for the given function address ADDR. */
static CORE_ADDR
locate_base (void)
{
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
CORE_ADDR address = 0;
msymbol = lookup_minimal_symbol (DEBUG_BASE, NULL, symfile_objfile);
- if ((msymbol != NULL) && (MSYMBOL_VALUE_ADDRESS (msymbol) != 0))
+ if ((msymbol.minsym != NULL) && (MSYMBOL_VALUE_ADDRESS (msymbol.minsym) != 0))
{
- address = MSYMBOL_VALUE_ADDRESS (msymbol);
+ address = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
}
return (address);
}
som_solib_create_inferior_hook (int from_tty)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
unsigned int dld_flags, status, have_endo;
asection *shlib_info;
gdb_byte buf[4];
annoyance to users of modern systems and foul up the testsuite as
well. As a result, the warnings have been disabled. */
msymbol = lookup_minimal_symbol ("__d_pid", NULL, symfile_objfile);
- if (msymbol == NULL)
+ if (msymbol.minsym == NULL)
goto keep_going;
- anaddr = MSYMBOL_VALUE_ADDRESS (msymbol);
+ anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
store_unsigned_integer (buf, 4, byte_order, ptid_get_pid (inferior_ptid));
status = target_write_memory (anaddr, buf, 4);
if (status != 0)
We'll look first for the old flavor and then the new. */
msymbol = lookup_minimal_symbol ("_DLD_HOOK", NULL, symfile_objfile);
- if (msymbol == NULL)
+ if (msymbol.minsym == NULL)
msymbol = lookup_minimal_symbol ("__d_trap", NULL, symfile_objfile);
- if (msymbol == NULL)
+ if (msymbol.minsym == NULL)
{
warning (_("\
Unable to find _DLD_HOOK symbol in object file.\n\
GDB will be unable to track shl_load/shl_unload calls"));
goto keep_going;
}
- anaddr = MSYMBOL_VALUE_ADDRESS (msymbol);
+ anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
dld_cache.hook.address = anaddr;
/* Grrr, this might not be an export symbol! We have to find the
export stub. */
- msymbol = hppa_lookup_stub_minimal_symbol (MSYMBOL_LINKAGE_NAME (msymbol),
- EXPORT);
- if (msymbol != NULL)
+ msymbol
+ = hppa_lookup_stub_minimal_symbol (MSYMBOL_LINKAGE_NAME (msymbol.minsym),
+ EXPORT);
+ if (msymbol.minsym != NULL)
{
- anaddr = MSYMBOL_VALUE (msymbol);
+ anaddr = MSYMBOL_VALUE (msymbol.minsym);
dld_cache.hook_stub.address = anaddr;
}
store_unsigned_integer (buf, 4, byte_order, anaddr);
msymbol = lookup_minimal_symbol ("__dld_hook", NULL, symfile_objfile);
- if (msymbol == NULL)
+ if (msymbol.minsym == NULL)
{
warning (_("\
Unable to find __dld_hook symbol in object file.\n\
GDB will be unable to track shl_load/shl_unload calls"));
goto keep_going;
}
- anaddr = MSYMBOL_VALUE_ADDRESS (msymbol);
+ anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
status = target_write_memory (anaddr, buf, 4);
/* Now set a shlib_event breakpoint at __d_trap so we can track
significant shared library events. */
msymbol = lookup_minimal_symbol ("__d_trap", NULL, symfile_objfile);
- if (msymbol == NULL)
+ if (msymbol.minsym == NULL)
{
warning (_("\
Unable to find __dld_d_trap symbol in object file.\n\
goto keep_going;
}
create_solib_event_breakpoint (target_gdbarch (),
- MSYMBOL_VALUE_ADDRESS (msymbol));
+ MSYMBOL_VALUE_ADDRESS (msymbol.minsym));
/* We have all the support usually found in end.o, so we can track
shl_load and shl_unload calls. */
/* Get the address of __dld_flags, if no such symbol exists, then we can
not debug the shared code. */
msymbol = lookup_minimal_symbol ("__dld_flags", NULL, NULL);
- if (msymbol == NULL)
+ if (msymbol.minsym == NULL)
{
error (_("Unable to find __dld_flags symbol in object file."));
}
- anaddr = MSYMBOL_VALUE_ADDRESS (msymbol);
+ anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
/* Read the current contents. */
status = target_read_memory (anaddr, buf, 4);
loaded at startup time (what a crock). */
msymbol = lookup_minimal_symbol ("_start", NULL, symfile_objfile);
- if (msymbol == NULL)
+ if (msymbol.minsym == NULL)
error (_("Unable to find _start symbol in object file."));
- anaddr = MSYMBOL_VALUE_ADDRESS (msymbol);
+ anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
/* Make the breakpoint at "_start" a shared library event breakpoint. */
create_solib_event_breakpoint (target_gdbarch (), anaddr);
{
struct objfile *objfile;
struct unwind_table_entry *u;
- struct minimal_symbol *dld_msymbol;
+ struct bound_minimal_symbol dld_msymbol;
/* Do we already know the value of these symbols? If so, then
we've no work to do.
ALL_OBJFILES (objfile)
{
dld_msymbol = lookup_minimal_symbol ("shl_load", NULL, objfile);
- if (dld_msymbol != NULL)
+ if (dld_msymbol.minsym != NULL)
{
- dld_cache.load.address = MSYMBOL_VALUE (dld_msymbol);
+ dld_cache.load.address = MSYMBOL_VALUE (dld_msymbol.minsym);
dld_cache.load.unwind = find_unwind_entry (dld_cache.load.address);
}
dld_msymbol = lookup_minimal_symbol_solib_trampoline ("shl_load",
objfile);
- if (dld_msymbol != NULL)
+ if (dld_msymbol.minsym != NULL)
{
- if (MSYMBOL_TYPE (dld_msymbol) == mst_solib_trampoline)
+ if (MSYMBOL_TYPE (dld_msymbol.minsym) == mst_solib_trampoline)
{
- u = find_unwind_entry (MSYMBOL_VALUE (dld_msymbol));
+ u = find_unwind_entry (MSYMBOL_VALUE (dld_msymbol.minsym));
if ((u != NULL) && (u->stub_unwind.stub_type == EXPORT))
{
- dld_cache.load_stub.address = MSYMBOL_VALUE (dld_msymbol);
+ dld_cache.load_stub.address
+ = MSYMBOL_VALUE (dld_msymbol.minsym);
dld_cache.load_stub.unwind = u;
}
}
}
dld_msymbol = lookup_minimal_symbol ("shl_unload", NULL, objfile);
- if (dld_msymbol != NULL)
+ if (dld_msymbol.minsym != NULL)
{
- dld_cache.unload.address = MSYMBOL_VALUE (dld_msymbol);
+ dld_cache.unload.address = MSYMBOL_VALUE (dld_msymbol.minsym);
dld_cache.unload.unwind = find_unwind_entry (dld_cache.unload.address);
/* ??rehrauer: I'm not sure exactly what this is, but it appears
dld_msymbol = lookup_minimal_symbol_solib_trampoline ("shl_unload",
objfile);
- if (dld_msymbol != NULL)
+ if (dld_msymbol.minsym != NULL)
{
- if (MSYMBOL_TYPE (dld_msymbol) == mst_solib_trampoline)
+ if (MSYMBOL_TYPE (dld_msymbol.minsym) == mst_solib_trampoline)
{
- u = find_unwind_entry (MSYMBOL_VALUE (dld_msymbol));
+ u = find_unwind_entry (MSYMBOL_VALUE (dld_msymbol.minsym));
if ((u != NULL) && (u->stub_unwind.stub_type == EXPORT))
{
- dld_cache.unload_stub.address = MSYMBOL_VALUE (dld_msymbol);
+ dld_cache.unload_stub.address
+ = MSYMBOL_VALUE (dld_msymbol.minsym);
dld_cache.unload_stub.unwind = u;
}
}
link_map_start (void)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
- struct minimal_symbol *sym;
+ struct bound_minimal_symbol sym;
CORE_ADDR addr;
gdb_byte buf[4];
unsigned int dld_flags;
sym = lookup_minimal_symbol ("__dld_flags", NULL, NULL);
- if (!sym)
+ if (!sym.minsym)
error (_("Unable to find __dld_flags symbol in object file."));
- addr = MSYMBOL_VALUE_ADDRESS (sym);
+ addr = MSYMBOL_VALUE_ADDRESS (sym.minsym);
read_memory (addr, buf, 4);
dld_flags = extract_unsigned_integer (buf, 4, byte_order);
if ((dld_flags & DLD_FLAGS_LISTVALID) == 0)
error (_("__dld_list is not valid according to __dld_flags."));
sym = lookup_minimal_symbol ("__dld_list", NULL, NULL);
- if (!sym)
+ if (!sym.minsym)
{
/* Older crt0.o files (hpux8) don't have __dld_list as a symbol,
but the data is still available if you know where to look. */
sym = lookup_minimal_symbol ("__dld_flags", NULL, NULL);
- if (!sym)
+ if (!sym.minsym)
{
error (_("Unable to find dynamic library list."));
return 0;
}
- addr = MSYMBOL_VALUE_ADDRESS (sym) - 8;
+ addr = MSYMBOL_VALUE_ADDRESS (sym.minsym) - 8;
}
else
- addr = MSYMBOL_VALUE_ADDRESS (sym);
+ addr = MSYMBOL_VALUE_ADDRESS (sym.minsym);
read_memory (addr, buf, 4);
addr = extract_unsigned_integer (buf, 4, byte_order);
static int
spu_enable_break (struct objfile *objfile)
{
- struct minimal_symbol *spe_event_sym = NULL;
+ struct bound_minimal_symbol spe_event_sym;
/* The libspe library will call __spe_context_update_event whenever any
SPE context is allocated or destroyed. */
NULL, objfile);
/* Place a solib_event breakpoint on the symbol. */
- if (spe_event_sym)
+ if (spe_event_sym.minsym)
{
- CORE_ADDR addr = MSYMBOL_VALUE_ADDRESS (spe_event_sym);
+ CORE_ADDR addr = MSYMBOL_VALUE_ADDRESS (spe_event_sym.minsym);
addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (), addr,
¤t_target);
static void
ocl_enable_break (struct objfile *objfile)
{
- struct minimal_symbol *event_sym = NULL;
- struct minimal_symbol *addr_sym = NULL;
+ struct bound_minimal_symbol event_sym;
+ struct bound_minimal_symbol addr_sym;
/* The OpenCL runtime on the SPU will call __opencl_program_update_event
whenever an OpenCL program is loaded. */
at opencl_elf_image_address. */
addr_sym = lookup_minimal_symbol ("opencl_elf_image_address", NULL, objfile);
- if (event_sym && addr_sym)
+ if (event_sym.minsym && addr_sym.minsym)
{
/* Place a solib_event breakpoint on the symbol. */
- CORE_ADDR event_addr = MSYMBOL_VALUE_ADDRESS (event_sym);
+ CORE_ADDR event_addr = MSYMBOL_VALUE_ADDRESS (event_sym.minsym);
create_solib_event_breakpoint (get_objfile_arch (objfile), event_addr);
/* Store the address of the symbol that will point to OpenCL program
&objfile->objfile_obstack,
objfile->sections_end - objfile->sections,
CORE_ADDR);
- *ocl_program_addr_base = MSYMBOL_VALUE_ADDRESS (addr_sym);
+ *ocl_program_addr_base = MSYMBOL_VALUE_ADDRESS (addr_sym.minsym);
set_objfile_data (objfile, ocl_program_data_key,
ocl_program_addr_base);
}
static CORE_ADDR
elf_locate_base (void)
{
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
CORE_ADDR dyn_ptr;
/* Look for DT_MIPS_RLD_MAP first. MIPS executables use this
/* This may be a static executable. Look for the symbol
conventionally named _r_debug, as a last resort. */
msymbol = lookup_minimal_symbol ("_r_debug", NULL, symfile_objfile);
- if (msymbol != NULL)
- return MSYMBOL_VALUE_ADDRESS (msymbol);
+ if (msymbol.minsym != NULL)
+ return MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
/* DT_DEBUG entry not found. */
return 0;
static int
enable_break (struct svr4_info *info, int from_tty)
{
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
const char * const *bkpt_namep;
asection *interp_sect;
char *interp_name;
for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++)
{
msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile);
- if ((msymbol != NULL) && (MSYMBOL_VALUE_ADDRESS (msymbol) != 0))
+ if ((msymbol.minsym != NULL)
+ && (MSYMBOL_VALUE_ADDRESS (msymbol.minsym) != 0))
{
- sym_addr = MSYMBOL_VALUE_ADDRESS (msymbol);
+ sym_addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr,
¤t_target);
for (bkpt_namep = bkpt_names; *bkpt_namep != NULL; bkpt_namep++)
{
msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile);
- if ((msymbol != NULL) && (MSYMBOL_VALUE_ADDRESS (msymbol) != 0))
+ if ((msymbol.minsym != NULL)
+ && (MSYMBOL_VALUE_ADDRESS (msymbol.minsym) != 0))
{
- sym_addr = MSYMBOL_VALUE_ADDRESS (msymbol);
+ sym_addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr,
¤t_target);
{
enum bfd_endian byte_order = bfd_big_endian (objfile->obfd)?
BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
- struct minimal_symbol *ovly_table_msym, *ovly_buf_table_msym;
+ struct bound_minimal_symbol ovly_table_msym, ovly_buf_table_msym;
CORE_ADDR ovly_table_base, ovly_buf_table_base;
unsigned ovly_table_size, ovly_buf_table_size;
struct spu_overlay_table *tbl;
return tbl;
ovly_table_msym = lookup_minimal_symbol ("_ovly_table", NULL, objfile);
- if (!ovly_table_msym)
+ if (!ovly_table_msym.minsym)
return NULL;
ovly_buf_table_msym = lookup_minimal_symbol ("_ovly_buf_table",
NULL, objfile);
- if (!ovly_buf_table_msym)
+ if (!ovly_buf_table_msym.minsym)
return NULL;
- ovly_table_base = MSYMBOL_VALUE_ADDRESS (ovly_table_msym);
- ovly_table_size = MSYMBOL_SIZE (ovly_table_msym);
+ ovly_table_base = MSYMBOL_VALUE_ADDRESS (ovly_table_msym.minsym);
+ ovly_table_size = MSYMBOL_SIZE (ovly_table_msym.minsym);
- ovly_buf_table_base = MSYMBOL_VALUE_ADDRESS (ovly_buf_table_msym);
- ovly_buf_table_size = MSYMBOL_SIZE (ovly_buf_table_msym);
+ ovly_buf_table_base = MSYMBOL_VALUE_ADDRESS (ovly_buf_table_msym.minsym);
+ ovly_buf_table_size = MSYMBOL_SIZE (ovly_buf_table_msym.minsym);
ovly_table = xmalloc (ovly_table_size);
read_memory (ovly_table_base, ovly_table, ovly_table_size);
static void
spu_catch_start (struct objfile *objfile)
{
- struct minimal_symbol *minsym;
+ struct bound_minimal_symbol minsym;
struct symtab *symtab;
CORE_ADDR pc;
char buf[32];
/* There can be multiple symbols named "main". Search for the
"main" in *this* objfile. */
minsym = lookup_minimal_symbol ("main", NULL, objfile);
- if (!minsym)
+ if (!minsym.minsym)
return;
/* If we have debugging information, try to use it -- this
will allow us to properly skip the prologue. */
- pc = MSYMBOL_VALUE_ADDRESS (minsym);
- symtab = find_pc_sect_symtab (pc, MSYMBOL_OBJ_SECTION (objfile, minsym));
+ pc = MSYMBOL_VALUE_ADDRESS (minsym.minsym);
+ symtab = find_pc_sect_symtab (pc, MSYMBOL_OBJ_SECTION (minsym.objfile,
+ minsym.minsym));
if (symtab != NULL)
{
struct blockvector *bv = BLOCKVECTOR (symtab);
static void
flush_ea_cache (void)
{
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
struct objfile *obj;
if (!has_stack_frames ())
/* Lookup inferior function __cache_flush. */
msymbol = lookup_minimal_symbol ("__cache_flush", NULL, obj);
- if (msymbol != NULL)
+ if (msymbol.minsym != NULL)
{
struct type *type;
CORE_ADDR addr;
type = objfile_type (obj)->builtin_void;
type = lookup_function_type (type);
type = lookup_pointer_type (type);
- addr = MSYMBOL_VALUE_ADDRESS (msymbol);
+ addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
call_function_by_hand (value_from_pointer (type, addr), 0, NULL);
}
SYMBOL_LINKAGE_NAME (sym))
!= SYMBOL_LINKAGE_NAME (sym))
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
NULL, objfile);
- if (msym != NULL)
+ if (msym.minsym != NULL)
{
const char *new_name = gdbarch_static_transform_name
(gdbarch, SYMBOL_LINKAGE_NAME (sym));
SYMBOL_SET_LINKAGE_NAME (sym, new_name);
- SYMBOL_VALUE_ADDRESS (sym) = MSYMBOL_VALUE_ADDRESS (msym);
+ SYMBOL_VALUE_ADDRESS (sym) = MSYMBOL_VALUE_ADDRESS (msym.minsym);
}
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_LINKAGE_NAME (sym))
!= SYMBOL_LINKAGE_NAME (sym))
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
NULL, objfile);
- if (msym != NULL)
+ if (msym.minsym != NULL)
{
const char *new_name = gdbarch_static_transform_name
(gdbarch, SYMBOL_LINKAGE_NAME (sym));
SYMBOL_SET_LINKAGE_NAME (sym, new_name);
- SYMBOL_VALUE_ADDRESS (sym) = MSYMBOL_VALUE_ADDRESS (msym);
+ SYMBOL_VALUE_ADDRESS (sym) = MSYMBOL_VALUE_ADDRESS (msym.minsym);
}
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
static int
simple_read_overlay_table (void)
{
- struct minimal_symbol *novlys_msym;
+ struct bound_minimal_symbol novlys_msym;
struct bound_minimal_symbol ovly_table_msym;
struct gdbarch *gdbarch;
int word_size;
simple_free_overlay_table ();
novlys_msym = lookup_minimal_symbol ("_novlys", NULL, NULL);
- if (! novlys_msym)
+ if (! novlys_msym.minsym)
{
error (_("Error reading inferior's overlay table: "
"couldn't find `_novlys' variable\n"
word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
byte_order = gdbarch_byte_order (gdbarch);
- cache_novlys = read_memory_integer (MSYMBOL_VALUE_ADDRESS (novlys_msym),
- 4, byte_order);
+ cache_novlys
+ = read_memory_integer (MSYMBOL_VALUE_ADDRESS (novlys_msym.minsym),
+ 4, byte_order);
cache_ovly_table
= (void *) xmalloc (cache_novlys * sizeof (*cache_ovly_table));
cache_ovly_table_base = MSYMBOL_VALUE_ADDRESS (ovly_table_msym.minsym);
{
/* Does its cached location match what's currently in the
symtab? */
- struct minimal_symbol *minsym
+ struct bound_minimal_symbol minsym
= lookup_minimal_symbol ("_ovly_table", NULL, NULL);
- if (minsym == NULL)
+ if (minsym.minsym == NULL)
error (_("Error reading inferior's overlay table: couldn't "
"find `_ovly_table' array\n"
"in inferior. Use `overlay manual' mode."));
- if (cache_ovly_table_base == MSYMBOL_VALUE_ADDRESS (minsym))
+ if (cache_ovly_table_base == MSYMBOL_VALUE_ADDRESS (minsym.minsym))
/* Then go ahead and try to look up this single section in
the cache. */
if (simple_overlay_update_1 (osect))
{
mfunsym
= lookup_minimal_symbol_text (MSYMBOL_LINKAGE_NAME (msymbol.minsym),
- NULL);
+ NULL).minsym;
if (mfunsym == NULL)
/* I eliminated this warning since it is coming out
* in the following situation:
{
struct symtabs_and_lines sals;
struct symbol *sym;
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
struct block *block;
const char *symname;
char *save_args = args;
case LOC_UNRESOLVED:
msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
NULL, NULL);
- if (msym == NULL)
+ if (msym.minsym == NULL)
printf_filtered ("Unresolved Static");
else
{
printf_filtered ("static storage at address ");
printf_filtered ("%s",
paddress (gdbarch,
- MSYMBOL_VALUE_ADDRESS (msym)));
+ MSYMBOL_VALUE_ADDRESS (msym.minsym)));
}
break;
case LOC_OPTIMIZED_OUT:
if (element->addr == 0)
{
- struct minimal_symbol *main_symbol;
+ struct bound_minimal_symbol main_symbol;
/* Find address of the start of program.
Note: this should be language specific. */
main_symbol = lookup_minimal_symbol ("main", NULL, NULL);
- if (main_symbol == 0)
+ if (main_symbol.minsym == 0)
main_symbol = lookup_minimal_symbol ("MAIN", NULL, NULL);
- if (main_symbol == 0)
+ if (main_symbol.minsym == 0)
main_symbol = lookup_minimal_symbol ("_start", NULL, NULL);
- if (main_symbol)
- addr = MSYMBOL_VALUE_ADDRESS (main_symbol);
+ if (main_symbol.minsym)
+ addr = MSYMBOL_VALUE_ADDRESS (main_symbol.minsym);
else
addr = 0;
}
{
/* With some compilers, e.g. HP aCC, static data members are
reported as non-debuggable symbols. */
- struct minimal_symbol *msym = lookup_minimal_symbol (phys_name,
- NULL, NULL);
+ struct bound_minimal_symbol msym
+ = lookup_minimal_symbol (phys_name, NULL, NULL);
- if (!msym)
+ if (!msym.minsym)
return allocate_optimized_out_value (type);
else
{
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
- MSYMBOL_VALUE_ADDRESS (msym));
+ MSYMBOL_VALUE_ADDRESS (msym.minsym));
}
}
else