gdb: make lookup_minimal_symbol objf and sfile parameters optional

Most calls to lookup_minimal_symbol don't pass a value for sfile and
objf.  Make these parameters optional (have a default value of
nullptr).  And since passing a value to `objf` is much more common than
passing a value to `sfile`, swap the order so `objf` comes first, to
avoid having to pass a nullptr value to `sfile` when wanting to pass a
value to `objf`.

Change-Id: I8e9cc6b942e593bec640f9dfd30f62786b0f5a27
Reviewed-by: Keith Seitz <keiths@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
This commit is contained in:
Simon Marchi
2024-07-16 23:52:00 -04:00
committed by Simon Marchi
parent 03b40f6f55
commit c8979ae4fb
57 changed files with 104 additions and 133 deletions

View File

@@ -806,7 +806,7 @@ ada_main_name ()
that string, then most probably the main procedure is not written that string, then most probably the main procedure is not written
in Ada. */ in Ada. */
bound_minimal_symbol msym bound_minimal_symbol msym
= lookup_minimal_symbol (ADA_MAIN_PROGRAM_SYMBOL_NAME, NULL, NULL); = lookup_minimal_symbol (ADA_MAIN_PROGRAM_SYMBOL_NAME);
if (msym.minsym != NULL) if (msym.minsym != NULL)
{ {
@@ -11696,7 +11696,7 @@ ada_has_this_exception_support (const struct exception_support_info *einfo)
the catchpoint message, and is also used when trying to catch the catchpoint message, and is also used when trying to catch
a specific exception). We do not handle this case for now. */ a specific exception). We do not handle this case for now. */
bound_minimal_symbol msym bound_minimal_symbol msym
= lookup_minimal_symbol (einfo->catch_exception_sym, NULL, NULL); = lookup_minimal_symbol (einfo->catch_exception_sym);
if (msym.minsym && msym.minsym->type () != mst_solib_trampoline) if (msym.minsym && msym.minsym->type () != mst_solib_trampoline)
error (_("Your Ada runtime appears to be missing some debugging " error (_("Your Ada runtime appears to be missing some debugging "
@@ -11716,7 +11716,7 @@ ada_has_this_exception_support (const struct exception_support_info *einfo)
if (sym == NULL) if (sym == NULL)
{ {
bound_minimal_symbol msym bound_minimal_symbol msym
= lookup_minimal_symbol (einfo->catch_handlers_sym, NULL, NULL); = lookup_minimal_symbol (einfo->catch_handlers_sym);
if (msym.minsym && msym.minsym->type () != mst_solib_trampoline) if (msym.minsym && msym.minsym->type () != mst_solib_trampoline)
error (_("Your Ada runtime appears to be missing some debugging " error (_("Your Ada runtime appears to be missing some debugging "

View File

@@ -920,8 +920,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
/* Try array. */ /* Try array. */
bound_minimal_symbol msym bound_minimal_symbol msym = lookup_minimal_symbol (KNOWN_TASKS_NAME);
= lookup_minimal_symbol (KNOWN_TASKS_NAME, NULL, NULL);
if (msym.minsym != NULL) if (msym.minsym != NULL)
{ {
data->known_tasks_kind = ADA_TASKS_ARRAY; data->known_tasks_kind = ADA_TASKS_ARRAY;
@@ -968,7 +967,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
/* Try list. */ /* Try list. */
msym = lookup_minimal_symbol (KNOWN_TASKS_LIST, NULL, NULL); msym = lookup_minimal_symbol (KNOWN_TASKS_LIST);
if (msym.minsym != NULL) if (msym.minsym != NULL)
{ {
data->known_tasks_kind = ADA_TASKS_LIST; data->known_tasks_kind = ADA_TASKS_LIST;

View File

@@ -395,7 +395,7 @@ pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, int co
symbols[i].addr = 0; symbols[i].addr = 0;
else else
{ {
bound_minimal_symbol ms = lookup_minimal_symbol (name, NULL, NULL); bound_minimal_symbol ms = lookup_minimal_symbol (name);
if (ms.minsym == NULL) if (ms.minsym == NULL)
{ {
if (debug_aix_thread) if (debug_aix_thread)
@@ -978,7 +978,7 @@ pd_enable (inferior *inf)
return; return;
/* Set a breakpoint on the returned stub function. */ /* Set a breakpoint on the returned stub function. */
bound_minimal_symbol ms = lookup_minimal_symbol (stub_name, NULL, NULL); bound_minimal_symbol ms = lookup_minimal_symbol (stub_name);
if (ms.minsym == NULL) if (ms.minsym == NULL)
return; return;
data->pd_brk_addr = ms.value_address (); data->pd_brk_addr = ms.value_address ();

View File

@@ -506,8 +506,7 @@ arc_linux_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
So we look for the symbol `_dl_linux_resolver', and if we are there, So we look for the symbol `_dl_linux_resolver', and if we are there,
gdb sets a breakpoint at the return address, and continues. */ gdb sets a breakpoint at the return address, and continues. */
bound_minimal_symbol resolver bound_minimal_symbol resolver = lookup_minimal_symbol ("_dl_linux_resolver");
= lookup_minimal_symbol ("_dl_linux_resolver", NULL, NULL);
if (arc_debug) if (arc_debug)
{ {

View File

@@ -9388,8 +9388,7 @@ arm_skip_cmse_entry (CORE_ADDR pc, const char *name, struct objfile *objfile)
char *target_name = (char *) alloca (target_len); char *target_name = (char *) alloca (target_len);
xsnprintf (target_name, target_len, "%s%s", "__acle_se_", name); xsnprintf (target_name, target_len, "%s%s", "__acle_se_", name);
bound_minimal_symbol minsym bound_minimal_symbol minsym = lookup_minimal_symbol (target_name, objfile);
= lookup_minimal_symbol (target_name, NULL, objfile);
if (minsym.minsym != nullptr) if (minsym.minsym != nullptr)
return minsym.value_address (); return minsym.value_address ();
@@ -9478,7 +9477,7 @@ arm_skip_stub (const frame_info_ptr &frame, CORE_ADDR pc)
sec = find_pc_section (pc); sec = find_pc_section (pc);
objfile = (sec == NULL) ? NULL : sec->objfile; objfile = (sec == NULL) ? NULL : sec->objfile;
bound_minimal_symbol minsym bound_minimal_symbol minsym
= lookup_minimal_symbol (target_name, NULL, objfile); = lookup_minimal_symbol (target_name, objfile);
if (minsym.minsym != NULL) if (minsym.minsym != NULL)
return minsym.value_address (); return minsym.value_address ();
else else

View File

@@ -90,7 +90,7 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
LONGEST retval; LONGEST retval;
size_t block; size_t block;
bound_minimal_symbol msym = lookup_minimal_symbol ("_dl_auxv", NULL, NULL); bound_minimal_symbol msym = lookup_minimal_symbol ("_dl_auxv");
if (msym.minsym == NULL) if (msym.minsym == NULL)
return TARGET_XFER_E_IO; return TARGET_XFER_E_IO;

View File

@@ -623,7 +623,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
pc_offset += 2; pc_offset += 2;
bound_minimal_symbol msymbol bound_minimal_symbol msymbol
= lookup_minimal_symbol ("__prologue_saves__", NULL, NULL); = lookup_minimal_symbol ("__prologue_saves__");
if (!msymbol.minsym) if (!msymbol.minsym)
break; break;

View File

@@ -599,7 +599,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
case LOC_UNRESOLVED: case LOC_UNRESOLVED:
{ {
bound_minimal_symbol msym bound_minimal_symbol msym
= lookup_minimal_symbol (var->linkage_name (), NULL, NULL); = lookup_minimal_symbol (var->linkage_name ());
if (!msym.minsym) if (!msym.minsym)
error (_("Couldn't resolve symbol `%s'."), var->print_name ()); error (_("Couldn't resolve symbol `%s'."), var->print_name ());

View File

@@ -3752,7 +3752,7 @@ create_std_terminate_master_breakpoint (void)
if (bp_objfile_data->terminate_msym.minsym == NULL) if (bp_objfile_data->terminate_msym.minsym == NULL)
{ {
bound_minimal_symbol m bound_minimal_symbol m
= lookup_minimal_symbol (func_name, NULL, objfile); = lookup_minimal_symbol (func_name, objfile);
if (m.minsym == NULL || (m.minsym->type () != mst_text if (m.minsym == NULL || (m.minsym->type () != mst_text
&& m.minsym->type () != mst_file_text)) && m.minsym->type () != mst_file_text))
{ {

View File

@@ -157,7 +157,7 @@ static int bsd_uthread_active;
static CORE_ADDR static CORE_ADDR
bsd_uthread_lookup_address (const char *name, struct objfile *objfile) bsd_uthread_lookup_address (const char *name, struct objfile *objfile)
{ {
bound_minimal_symbol sym = lookup_minimal_symbol (name, NULL, objfile); bound_minimal_symbol sym = lookup_minimal_symbol (name, objfile);
if (sym.minsym) if (sym.minsym)
return sym.value_address (); return sym.value_address ();

View File

@@ -3150,7 +3150,7 @@ classify_name (struct parser_state *par_state, const struct block *block,
if (bsym.symbol == NULL if (bsym.symbol == NULL
&& par_state->language ()->la_language == language_cplus && par_state->language ()->la_language == language_cplus
&& is_a_field_of_this.type == NULL && is_a_field_of_this.type == NULL
&& lookup_minimal_symbol (copy.c_str (), NULL, NULL).minsym == NULL) && lookup_minimal_symbol (copy.c_str ()).minsym == nullptr)
return UNKNOWN_CPP_NAME; return UNKNOWN_CPP_NAME;
return NAME; return NAME;

View File

@@ -579,7 +579,7 @@ coff_read_minsyms (file_ptr symtab_offset, unsigned int nsyms,
name1 += 1; name1 += 1;
bound_minimal_symbol found bound_minimal_symbol found
= lookup_minimal_symbol (name1, NULL, objfile); = lookup_minimal_symbol (name1, objfile);
/* If found, there are symbols named "_imp_foo" and "foo" /* If found, there are symbols named "_imp_foo" and "foo"
respectively in OBJFILE. Set the type of symbol "foo" respectively in OBJFILE. Set the type of symbol "foo"

View File

@@ -355,8 +355,7 @@ gcc_convert_symbol (void *datum,
} }
else if (request == GCC_C_ORACLE_SYMBOL) else if (request == GCC_C_ORACLE_SYMBOL)
{ {
bound_minimal_symbol bmsym bound_minimal_symbol bmsym = lookup_minimal_symbol (identifier);
= lookup_minimal_symbol (identifier, NULL, NULL);
if (bmsym.minsym != NULL) if (bmsym.minsym != NULL)
{ {
convert_symbol_bmsym (context, bmsym); convert_symbol_bmsym (context, bmsym);

View File

@@ -764,8 +764,7 @@ compile_object_load (const compile_file_names &file_names,
continue; continue;
} }
bound_minimal_symbol bmsym bound_minimal_symbol bmsym = lookup_minimal_symbol (sym->name);
= lookup_minimal_symbol (sym->name, NULL, NULL);
switch (bmsym.minsym == NULL switch (bmsym.minsym == NULL
? mst_unknown : bmsym.minsym->type ()) ? mst_unknown : bmsym.minsym->type ())
{ {

View File

@@ -323,7 +323,7 @@ get_bitsize (ctf_dict_t *fp, ctf_id_t tid, uint32_t kind)
static void static void
set_symbol_address (struct objfile *of, struct symbol *sym, const char *name) set_symbol_address (struct objfile *of, struct symbol *sym, const char *name)
{ {
bound_minimal_symbol msym = lookup_minimal_symbol (name, nullptr, of); bound_minimal_symbol msym = lookup_minimal_symbol (name, of);
if (msym.minsym != NULL) if (msym.minsym != NULL)
{ {
sym->set_value_address (msym.value_address ()); sym->set_value_address (msym.value_address ());

View File

@@ -38,7 +38,7 @@ static const char D_MAIN[] = "D main";
const char * const char *
d_main_name (void) d_main_name (void)
{ {
bound_minimal_symbol msym = lookup_minimal_symbol (D_MAIN, NULL, NULL); bound_minimal_symbol msym = lookup_minimal_symbol (D_MAIN);
if (msym.minsym != NULL) if (msym.minsym != NULL)
return D_MAIN; return D_MAIN;

View File

@@ -907,7 +907,7 @@ find_stab_function (const char *namestring, const char *filename,
strncpy (p, namestring, n); strncpy (p, namestring, n);
p[n] = 0; p[n] = 0;
bound_minimal_symbol msym = lookup_minimal_symbol (p, filename, objfile); bound_minimal_symbol msym = lookup_minimal_symbol (p, objfile, filename);
if (msym.minsym == NULL) if (msym.minsym == NULL)
{ {
/* Sun Fortran appends an underscore to the minimal symbol name, /* Sun Fortran appends an underscore to the minimal symbol name,
@@ -915,21 +915,21 @@ find_stab_function (const char *namestring, const char *filename,
was not found. */ was not found. */
p[n] = '_'; p[n] = '_';
p[n + 1] = 0; p[n + 1] = 0;
msym = lookup_minimal_symbol (p, filename, objfile); msym = lookup_minimal_symbol (p, objfile, filename);
} }
if (msym.minsym == NULL && filename != NULL) if (msym.minsym == NULL && filename != NULL)
{ {
/* Try again without the filename. */ /* Try again without the filename. */
p[n] = 0; p[n] = 0;
msym = lookup_minimal_symbol (p, NULL, objfile); msym = lookup_minimal_symbol (p, objfile);
} }
if (msym.minsym == NULL && filename != NULL) if (msym.minsym == NULL && filename != NULL)
{ {
/* And try again for Sun Fortran, but without the filename. */ /* And try again for Sun Fortran, but without the filename. */
p[n] = '_'; p[n] = '_';
p[n + 1] = 0; p[n + 1] = 0;
msym = lookup_minimal_symbol (p, NULL, objfile); msym = lookup_minimal_symbol (p, objfile);
} }
return msym; return msym;
@@ -2044,7 +2044,7 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
p[n] = 0; p[n] = 0;
bound_minimal_symbol minsym bound_minimal_symbol minsym
= lookup_minimal_symbol (p, pst->filename, objfile); = lookup_minimal_symbol (p, objfile, pst->filename);
if (minsym.minsym == NULL) if (minsym.minsym == NULL)
{ {
/* Sun Fortran appends an underscore to the minimal symbol name, /* Sun Fortran appends an underscore to the minimal symbol name,
@@ -2052,7 +2052,7 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
was not found. */ was not found. */
p[n] = '_'; p[n] = '_';
p[n + 1] = 0; p[n + 1] = 0;
minsym = lookup_minimal_symbol (p, pst->filename, objfile); minsym = lookup_minimal_symbol (p, objfile, pst->filename);
} }
if (minsym.minsym) if (minsym.minsym)

View File

@@ -710,8 +710,7 @@ call_site_target::iterate_over_addresses (gdbarch *call_site_gdbarch,
physname = m_loc.physname; physname = m_loc.physname;
/* Handle both the mangled and demangled PHYSNAME. */ /* Handle both the mangled and demangled PHYSNAME. */
bound_minimal_symbol msym bound_minimal_symbol msym = lookup_minimal_symbol (physname);
= lookup_minimal_symbol (physname, NULL, NULL);
if (msym.minsym == NULL) if (msym.minsym == NULL)
{ {
msym = lookup_minimal_symbol_by_pc (call_site->pc () - 1); msym = lookup_minimal_symbol_by_pc (call_site->pc () - 1);

View File

@@ -842,9 +842,9 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p)
CORE_ADDR pointer_address, addr; CORE_ADDR pointer_address, addr;
asection *plt; asection *plt;
gdb_byte *buf = (gdb_byte *) alloca (ptr_size); gdb_byte *buf = (gdb_byte *) alloca (ptr_size);
bound_minimal_symbol msym;
msym = lookup_minimal_symbol (name_got_plt, NULL, objfile); bound_minimal_symbol msym
= lookup_minimal_symbol (name_got_plt, objfile);
if (msym.minsym == NULL) if (msym.minsym == NULL)
return 0; return 0;
if (msym.minsym->type () != mst_slot_got_plt) if (msym.minsym->type () != mst_slot_got_plt)

View File

@@ -1954,7 +1954,7 @@ eval_op_objc_msgcall (struct type *expect_type, struct expression *exp,
if (value_as_long (target) == 0) if (value_as_long (target) == 0)
return value_from_longest (long_type, 0); return value_from_longest (long_type, 0);
if (lookup_minimal_symbol ("objc_msg_lookup", 0, 0).minsym) if (lookup_minimal_symbol ("objc_msg_lookup").minsym != nullptr)
gnu_runtime = 1; gnu_runtime = 1;
/* Find the method dispatch (Apple runtime) or method lookup /* Find the method dispatch (Apple runtime) or method lookup

View File

@@ -1943,7 +1943,7 @@ fbsd_get_syscall_number (struct gdbarch *gdbarch, thread_info *thread)
static LONGEST static LONGEST
fbsd_read_integer_by_name (struct gdbarch *gdbarch, const char *name) fbsd_read_integer_by_name (struct gdbarch *gdbarch, const char *name)
{ {
bound_minimal_symbol ms = lookup_minimal_symbol (name, NULL, NULL); bound_minimal_symbol ms = lookup_minimal_symbol (name);
if (ms.minsym == NULL) if (ms.minsym == NULL)
error (_("Unable to resolve symbol '%s'"), name); error (_("Unable to resolve symbol '%s'"), name);

View File

@@ -449,8 +449,7 @@ language_defn::read_var_value (struct symbol *var,
(var->arch (), (var->arch (),
[var, &bmsym] (objfile *objfile) [var, &bmsym] (objfile *objfile)
{ {
bmsym = lookup_minimal_symbol (var->linkage_name (), nullptr, bmsym = lookup_minimal_symbol (var->linkage_name (), objfile);
objfile);
/* Stop if a match is found. */ /* Stop if a match is found. */
return bmsym.minsym != nullptr; return bmsym.minsym != nullptr;

View File

@@ -2584,8 +2584,7 @@ inside_main_func (const frame_info_ptr &this_frame)
CORE_ADDR sym_addr = 0; CORE_ADDR sym_addr = 0;
const char *name = main_name (); const char *name = main_name ();
bound_minimal_symbol msymbol bound_minimal_symbol msymbol
= lookup_minimal_symbol (name, NULL, = lookup_minimal_symbol (name, current_program_space->symfile_object_file);
current_program_space->symfile_object_file);
if (msymbol.minsym != nullptr) if (msymbol.minsym != nullptr)
sym_addr = msymbol.value_address (); sym_addr = msymbol.value_address ();

View File

@@ -1379,8 +1379,7 @@ frv_frame_this_id (const frame_info_ptr &this_frame,
func = get_frame_func (this_frame); func = get_frame_func (this_frame);
/* Check if the stack is empty. */ /* Check if the stack is empty. */
bound_minimal_symbol msym_stack bound_minimal_symbol msym_stack = lookup_minimal_symbol ("_stack");
= lookup_minimal_symbol ("_stack", NULL, NULL);
if (msym_stack.minsym && info->base == msym_stack.value_address ()) if (msym_stack.minsym && info->base == msym_stack.value_address ())
return; return;

View File

@@ -195,8 +195,7 @@ ft32_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
snprintf (prolog_symbol, sizeof (prolog_symbol), "__prolog_$r%02d", snprintf (prolog_symbol, sizeof (prolog_symbol), "__prolog_$r%02d",
regnum); regnum);
bound_minimal_symbol msymbol bound_minimal_symbol msymbol = lookup_minimal_symbol (prolog_symbol);
= lookup_minimal_symbol (prolog_symbol, NULL, NULL);
if (msymbol.minsym) if (msymbol.minsym)
prologs[regnum] = msymbol.value_address (); prologs[regnum] = msymbol.value_address ();
else else

View File

@@ -269,13 +269,13 @@ call_target_sbrk (int sbrk_arg)
struct value *sbrk_fn, *ret; struct value *sbrk_fn, *ret;
bfd_vma tmp; bfd_vma tmp;
if (lookup_minimal_symbol ("sbrk", NULL, NULL).minsym != NULL) if (lookup_minimal_symbol ("sbrk").minsym != nullptr)
{ {
sbrk_fn = find_function_in_inferior ("sbrk", &sbrk_objf); sbrk_fn = find_function_in_inferior ("sbrk", &sbrk_objf);
if (sbrk_fn == NULL) if (sbrk_fn == NULL)
return (bfd_vma) 0; return (bfd_vma) 0;
} }
else if (lookup_minimal_symbol ("_sbrk", NULL, NULL).minsym != NULL) else if (lookup_minimal_symbol ("_sbrk").minsym != nullptr)
{ {
sbrk_fn = find_function_in_inferior ("_sbrk", &sbrk_objf); sbrk_fn = find_function_in_inferior ("_sbrk", &sbrk_objf);
if (sbrk_fn == NULL) if (sbrk_fn == NULL)

View File

@@ -59,11 +59,11 @@ glibc_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{ {
/* The dynamic linker began using this name in early 2005. */ /* The dynamic linker began using this name in early 2005. */
bound_minimal_symbol fixup bound_minimal_symbol fixup
= lookup_minimal_symbol ("_dl_fixup", NULL, resolver.objfile); = lookup_minimal_symbol ("_dl_fixup", resolver.objfile);
/* This is the name used in older versions. */ /* This is the name used in older versions. */
if (! fixup.minsym) if (! fixup.minsym)
fixup = lookup_minimal_symbol ("fixup", NULL, resolver.objfile); fixup = lookup_minimal_symbol ("fixup", resolver.objfile);
if (fixup.minsym && fixup.value_address () == pc) if (fixup.minsym && fixup.value_address () == pc)
return frame_unwind_caller_pc (get_current_frame ()); return frame_unwind_caller_pc (get_current_frame ());

View File

@@ -1160,8 +1160,7 @@ gnuv3_get_typeid (struct value *value)
else else
{ {
std::string sym_name = std::string ("typeinfo for ") + name; std::string sym_name = std::string ("typeinfo for ") + name;
bound_minimal_symbol minsym bound_minimal_symbol minsym = lookup_minimal_symbol (sym_name.c_str ());
= lookup_minimal_symbol (sym_name.c_str (), NULL, NULL);
if (minsym.minsym == NULL) if (minsym.minsym == NULL)
error (_("could not find typeinfo symbol for '%s'"), name); error (_("could not find typeinfo symbol for '%s'"), name);
@@ -1250,7 +1249,7 @@ gnuv3_skip_trampoline (const frame_info_ptr &frame, CORE_ADDR stop_pc)
fn_name = strstr (thunk_name, " thunk to ") + strlen (" thunk to "); fn_name = strstr (thunk_name, " thunk to ") + strlen (" thunk to ");
bound_minimal_symbol fn_sym bound_minimal_symbol fn_sym
= lookup_minimal_symbol (fn_name, NULL, section->objfile); = lookup_minimal_symbol (fn_name, section->objfile);
if (fn_sym.minsym == NULL) if (fn_sym.minsym == NULL)
return 0; return 0;

View File

@@ -54,7 +54,7 @@ static const char GO_MAIN_MAIN[] = "main.main";
const char * const char *
go_main_name (void) go_main_name (void)
{ {
bound_minimal_symbol msym = lookup_minimal_symbol (GO_MAIN_MAIN, NULL, NULL); bound_minimal_symbol msym = lookup_minimal_symbol (GO_MAIN_MAIN);
if (msym.minsym != NULL) if (msym.minsym != NULL)
return GO_MAIN_MAIN; return GO_MAIN_MAIN;

View File

@@ -194,7 +194,7 @@ hppa_extract_17 (unsigned word)
CORE_ADDR CORE_ADDR
hppa_symbol_address(const char *sym) hppa_symbol_address(const char *sym)
{ {
bound_minimal_symbol minsym = lookup_minimal_symbol (sym, NULL, NULL); bound_minimal_symbol minsym = lookup_minimal_symbol (sym);
if (minsym.minsym) if (minsym.minsym)
return minsym.value_address (); return minsym.value_address ();
else else

View File

@@ -484,10 +484,9 @@ inferior_call_waitpid (ptid_t pptid, int pid)
scoped_switch_fork_info switch_fork_info (pptid); scoped_switch_fork_info switch_fork_info (pptid);
/* Get the waitpid_fn. */ /* Get the waitpid_fn. */
if (lookup_minimal_symbol ("waitpid", NULL, NULL).minsym != NULL) if (lookup_minimal_symbol ("waitpid").minsym != nullptr)
waitpid_fn = find_function_in_inferior ("waitpid", &waitpid_objf); waitpid_fn = find_function_in_inferior ("waitpid", &waitpid_objf);
if (!waitpid_fn if (!waitpid_fn && lookup_minimal_symbol ("_waitpid").minsym != nullptr)
&& lookup_minimal_symbol ("_waitpid", NULL, NULL).minsym != NULL)
waitpid_fn = find_function_in_inferior ("_waitpid", &waitpid_objf); waitpid_fn = find_function_in_inferior ("_waitpid", &waitpid_objf);
if (waitpid_fn != nullptr) if (waitpid_fn != nullptr)
{ {
@@ -701,10 +700,10 @@ checkpoint_command (const char *args, int from_tty)
/* Make the inferior fork, record its (and gdb's) state. */ /* Make the inferior fork, record its (and gdb's) state. */
if (lookup_minimal_symbol ("fork", NULL, NULL).minsym != NULL) if (lookup_minimal_symbol ("fork").minsym != nullptr)
fork_fn = find_function_in_inferior ("fork", &fork_objf); fork_fn = find_function_in_inferior ("fork", &fork_objf);
if (!fork_fn) if (!fork_fn)
if (lookup_minimal_symbol ("_fork", NULL, NULL).minsym != NULL) if (lookup_minimal_symbol ("_fork").minsym != nullptr)
fork_fn = find_function_in_inferior ("fork", &fork_objf); fork_fn = find_function_in_inferior ("fork", &fork_objf);
if (!fork_fn) if (!fork_fn)
error (_("checkpoint: can't find fork function in inferior.")); error (_("checkpoint: can't find fork function in inferior."));

View File

@@ -470,8 +470,7 @@ inferior_has_bug (const char *ver_symbol, int ver_major_min, int ver_minor_min)
CORE_ADDR version_addr; CORE_ADDR version_addr;
int got, retval = 0; int got, retval = 0;
bound_minimal_symbol version_msym bound_minimal_symbol version_msym = lookup_minimal_symbol (ver_symbol);
= lookup_minimal_symbol (ver_symbol, NULL, NULL);
if (version_msym.minsym == NULL) if (version_msym.minsym == NULL)
return 0; return 0;
@@ -810,9 +809,7 @@ static bool
libpthread_objfile_p (objfile *obj) libpthread_objfile_p (objfile *obj)
{ {
return (libpthread_name_p (objfile_name (obj)) return (libpthread_name_p (objfile_name (obj))
&& lookup_minimal_symbol ("pthread_create", && lookup_minimal_symbol ("pthread_create", obj).minsym != nullptr);
NULL,
obj).minsym != NULL);
} }
/* Attempt to initialize dlopen()ed libthread_db, described by INFO. /* Attempt to initialize dlopen()ed libthread_db, described by INFO.

View File

@@ -2212,8 +2212,7 @@ m32c_return_value (struct gdbarch *gdbarch,
/* Everything else is passed in mem0, using as many bytes as /* Everything else is passed in mem0, using as many bytes as
needed. This is not what the Renesas tools do, but it's needed. This is not what the Renesas tools do, but it's
what GCC does at the moment. */ what GCC does at the moment. */
bound_minimal_symbol mem0 bound_minimal_symbol mem0 = lookup_minimal_symbol ("mem0");
= lookup_minimal_symbol ("mem0", NULL, NULL);
if (! mem0.minsym) if (! mem0.minsym)
error (_("The return value is stored in memory at 'mem0', " error (_("The return value is stored in memory at 'mem0', "
@@ -2244,8 +2243,7 @@ m32c_return_value (struct gdbarch *gdbarch,
/* Everything else is passed in mem0, using as many bytes as /* Everything else is passed in mem0, using as many bytes as
needed. This is not what the Renesas tools do, but it's needed. This is not what the Renesas tools do, but it's
what GCC does at the moment. */ what GCC does at the moment. */
bound_minimal_symbol mem0 bound_minimal_symbol mem0 = lookup_minimal_symbol ("mem0");
= lookup_minimal_symbol ("mem0", NULL, NULL);
if (! mem0.minsym) if (! mem0.minsym)
error (_("The return value is stored in memory at 'mem0', " error (_("The return value is stored in memory at 'mem0', "
@@ -2436,8 +2434,7 @@ m32c_m16c_address_to_pointer (struct gdbarch *gdbarch,
strcat (tramp_name, ".plt"); strcat (tramp_name, ".plt");
/* Try to find a linker symbol for the trampoline. */ /* Try to find a linker symbol for the trampoline. */
bound_minimal_symbol tramp_msym bound_minimal_symbol tramp_msym = lookup_minimal_symbol (tramp_name);
= lookup_minimal_symbol (tramp_name, NULL, NULL);
/* We've either got another copy of the name now, or don't need /* We've either got another copy of the name now, or don't need
the name any more. */ the name any more. */
@@ -2521,7 +2518,7 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch,
memcpy (func_name, ptr_msym_name, len - 4); memcpy (func_name, ptr_msym_name, len - 4);
func_name[len - 4] = '\0'; func_name[len - 4] = '\0';
bound_minimal_symbol func_msym bound_minimal_symbol func_msym
= lookup_minimal_symbol (func_name, NULL, NULL); = lookup_minimal_symbol (func_name);
/* If we do have such a symbol, return its value as the /* If we do have such a symbol, return its value as the
function's true address. */ function's true address. */

View File

@@ -806,8 +806,7 @@ m32r_frame_this_id (const frame_info_ptr &this_frame,
func = get_frame_func (this_frame); func = get_frame_func (this_frame);
/* Check if the stack is empty. */ /* Check if the stack is empty. */
bound_minimal_symbol msym_stack bound_minimal_symbol msym_stack = lookup_minimal_symbol ("_stack");
= lookup_minimal_symbol ("_stack", NULL, NULL);
if (msym_stack.minsym && info->base == msym_stack.value_address ()) if (msym_stack.minsym && info->base == msym_stack.value_address ())
return; return;

View File

@@ -210,7 +210,7 @@ static int soft_reg_initialized = 0;
static void static void
m68hc11_get_register_info (struct m68hc11_soft_reg *reg, const char *name) m68hc11_get_register_info (struct m68hc11_soft_reg *reg, const char *name)
{ {
bound_minimal_symbol msymbol = lookup_minimal_symbol (name, NULL, NULL); bound_minimal_symbol msymbol = lookup_minimal_symbol (name);
if (msymbol.minsym) if (msymbol.minsym)
{ {
reg->addr = msymbol.value_address (); reg->addr = msymbol.value_address ();

View File

@@ -396,7 +396,7 @@ macho_resolve_oso_sym_with_minsym (struct objfile *main_objfile, asymbol *sym)
&& *name == bfd_get_symbol_leading_char (main_objfile->obfd.get ())) && *name == bfd_get_symbol_leading_char (main_objfile->obfd.get ()))
++name; ++name;
bound_minimal_symbol msym = lookup_minimal_symbol (name, NULL, main_objfile); bound_minimal_symbol msym = lookup_minimal_symbol (name, main_objfile);
if (msym.minsym == NULL) if (msym.minsym == NULL)
{ {
warning (_("can't find symbol '%s' in minsymtab"), name); warning (_("can't find symbol '%s' in minsymtab"), name);

View File

@@ -359,8 +359,7 @@ lookup_minimal_symbol_demangled (const lookup_name_info &lookup_name,
but the demangled names are all the same: S::S or S::~S. */ but the demangled names are all the same: S::S or S::~S. */
bound_minimal_symbol bound_minimal_symbol
lookup_minimal_symbol (const char *name, const char *sfile, lookup_minimal_symbol (const char *name, objfile *objf, const char *sfile)
struct objfile *objf)
{ {
found_minimal_symbols found; found_minimal_symbols found;
@@ -479,7 +478,7 @@ lookup_minimal_symbol (const char *name, const char *sfile,
bound_minimal_symbol bound_minimal_symbol
lookup_bound_minimal_symbol (const char *name) lookup_bound_minimal_symbol (const char *name)
{ {
return lookup_minimal_symbol (name, NULL, NULL); return lookup_minimal_symbol (name);
} }
/* See gdbsupport/symbol.h. */ /* See gdbsupport/symbol.h. */
@@ -488,7 +487,7 @@ int
find_minimal_symbol_address (const char *name, CORE_ADDR *addr, find_minimal_symbol_address (const char *name, CORE_ADDR *addr,
struct objfile *objfile) struct objfile *objfile)
{ {
bound_minimal_symbol sym = lookup_minimal_symbol (name, NULL, objfile); bound_minimal_symbol sym = lookup_minimal_symbol (name, objfile);
if (sym.minsym != NULL) if (sym.minsym != NULL)
*addr = sym.value_address (); *addr = sym.value_address ();

View File

@@ -205,8 +205,9 @@ unsigned int msymbol_hash_iw (const char *);
symbols are still preferred). Returns a bound minimal symbol that symbols are still preferred). Returns a bound minimal symbol that
matches, or an empty bound minimal symbol if no match is found. */ matches, or an empty bound minimal symbol if no match is found. */
bound_minimal_symbol lookup_minimal_symbol (const char *, const char *, bound_minimal_symbol lookup_minimal_symbol (const char *name,
struct objfile *); objfile *obj = nullptr,
const char *sfile = nullptr);
/* Like lookup_minimal_symbol, but searches all files and /* Like lookup_minimal_symbol, but searches all files and
objfiles. */ objfiles. */

View File

@@ -700,7 +700,7 @@ static CORE_ADDR
mips_linux_skip_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) mips_linux_skip_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{ {
bound_minimal_symbol resolver bound_minimal_symbol resolver
= lookup_minimal_symbol ("__dl_runtime_resolve", NULL, NULL); = lookup_minimal_symbol ("__dl_runtime_resolve");
if (resolver.minsym && resolver.value_address () == pc) if (resolver.minsym && resolver.value_address () == pc)
return frame_unwind_caller_pc (get_current_frame ()); return frame_unwind_caller_pc (get_current_frame ());

View File

@@ -348,8 +348,7 @@ nbsd_gdb_signal_to_target (struct gdbarch *gdbarch,
static CORE_ADDR static CORE_ADDR
nbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) nbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{ {
bound_minimal_symbol msym bound_minimal_symbol msym = lookup_minimal_symbol ("_rtld_bind_start");
= lookup_minimal_symbol ("_rtld_bind_start", NULL, NULL);
if (msym.minsym && msym.value_address () == pc) if (msym.minsym && msym.value_address () == pc)
return frame_unwind_caller_pc (get_current_frame ()); return frame_unwind_caller_pc (get_current_frame ());
else else

View File

@@ -120,9 +120,9 @@ lookup_objc_class (struct gdbarch *gdbarch, const char *classname)
return 0; return 0;
} }
if (lookup_minimal_symbol("objc_lookUpClass", 0, 0).minsym) if (lookup_minimal_symbol ("objc_lookUpClass").minsym != nullptr)
function = find_function_in_inferior("objc_lookUpClass", NULL); function = find_function_in_inferior("objc_lookUpClass", NULL);
else if (lookup_minimal_symbol ("objc_lookup_class", 0, 0).minsym) else if (lookup_minimal_symbol ("objc_lookup_class").minsym != nullptr)
function = find_function_in_inferior("objc_lookup_class", NULL); function = find_function_in_inferior("objc_lookup_class", NULL);
else else
{ {
@@ -149,9 +149,9 @@ lookup_child_selector (struct gdbarch *gdbarch, const char *selname)
return 0; return 0;
} }
if (lookup_minimal_symbol("sel_getUid", 0, 0).minsym) if (lookup_minimal_symbol ("sel_getUid").minsym != nullptr)
function = find_function_in_inferior("sel_getUid", NULL); function = find_function_in_inferior("sel_getUid", NULL);
else if (lookup_minimal_symbol ("sel_get_any_uid", 0, 0).minsym) else if (lookup_minimal_symbol ("sel_get_any_uid").minsym != nullptr)
function = find_function_in_inferior("sel_get_any_uid", NULL); function = find_function_in_inferior("sel_get_any_uid", NULL);
else else
{ {
@@ -180,17 +180,18 @@ value_nsstring (struct gdbarch *gdbarch, const char *ptr, int len)
stringValue[2] = value_string(ptr, len, char_type); stringValue[2] = value_string(ptr, len, char_type);
stringValue[2] = value_coerce_array(stringValue[2]); stringValue[2] = value_coerce_array(stringValue[2]);
/* _NSNewStringFromCString replaces "istr" after Lantern2A. */ /* _NSNewStringFromCString replaces "istr" after Lantern2A. */
if (lookup_minimal_symbol("_NSNewStringFromCString", 0, 0).minsym) if (lookup_minimal_symbol ("_NSNewStringFromCString").minsym != nullptr)
{ {
function = find_function_in_inferior("_NSNewStringFromCString", NULL); function = find_function_in_inferior("_NSNewStringFromCString", NULL);
nsstringValue = call_function_by_hand(function, NULL, stringValue[2]); nsstringValue = call_function_by_hand(function, NULL, stringValue[2]);
} }
else if (lookup_minimal_symbol("istr", 0, 0).minsym) else if (lookup_minimal_symbol ("istr").minsym != nullptr)
{ {
function = find_function_in_inferior("istr", NULL); function = find_function_in_inferior("istr", NULL);
nsstringValue = call_function_by_hand(function, NULL, stringValue[2]); nsstringValue = call_function_by_hand(function, NULL, stringValue[2]);
} }
else if (lookup_minimal_symbol("+[NSString stringWithCString:]", 0, 0).minsym) else if (lookup_minimal_symbol ("+[NSString stringWithCString:]").minsym
!= nullptr)
{ {
function function
= find_function_in_inferior("+[NSString stringWithCString:]", NULL); = find_function_in_inferior("+[NSString stringWithCString:]", NULL);
@@ -1137,7 +1138,7 @@ find_imps (const char *method, std::vector<const char *> *symbol_names)
symbol_names->push_back (sym->natural_name ()); symbol_names->push_back (sym->natural_name ());
else else
{ {
bound_minimal_symbol msym = lookup_minimal_symbol (selector, 0, 0); bound_minimal_symbol msym = lookup_minimal_symbol (selector);
if (msym.minsym != NULL) if (msym.minsym != NULL)
symbol_names->push_back (msym.minsym->natural_name ()); symbol_names->push_back (msym.minsym->natural_name ());

View File

@@ -27,7 +27,7 @@
CORE_ADDR CORE_ADDR
obsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) obsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{ {
bound_minimal_symbol msym = lookup_minimal_symbol ("_dl_bind", NULL, NULL); bound_minimal_symbol msym = lookup_minimal_symbol ("_dl_bind");
if (msym.minsym && msym.value_address () == pc) if (msym.minsym && msym.value_address () == pc)
return frame_unwind_caller_pc (get_current_frame ()); return frame_unwind_caller_pc (get_current_frame ());
else else

View File

@@ -59,21 +59,20 @@ static const char GPC_MAIN_PROGRAM_NAME_2[] = "pascal_main_program";
const char * const char *
pascal_main_name (void) pascal_main_name (void)
{ {
bound_minimal_symbol msym bound_minimal_symbol msym = lookup_minimal_symbol (GPC_P_INITIALIZE);
= lookup_minimal_symbol (GPC_P_INITIALIZE, NULL, NULL);
/* If '_p_initialize' was not found, the main program is likely not /* If '_p_initialize' was not found, the main program is likely not
written in Pascal. */ written in Pascal. */
if (msym.minsym == NULL) if (msym.minsym == NULL)
return NULL; return NULL;
msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_1, NULL, NULL); msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_1);
if (msym.minsym != NULL) if (msym.minsym != NULL)
{ {
return GPC_MAIN_PROGRAM_NAME_1; return GPC_MAIN_PROGRAM_NAME_1;
} }
msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_2, NULL, NULL); msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_2);
if (msym.minsym != NULL) if (msym.minsym != NULL)
{ {
return GPC_MAIN_PROGRAM_NAME_2; return GPC_MAIN_PROGRAM_NAME_2;

View File

@@ -1060,7 +1060,7 @@ convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr)
- avoids problems when two object files (i.e., shared libraries) - avoids problems when two object files (i.e., shared libraries)
contain a minimal symbol with the same name. */ contain a minimal symbol with the same name. */
bound_minimal_symbol fn bound_minimal_symbol fn
= lookup_minimal_symbol (dot_fn.minsym->linkage_name () + 1, NULL, = lookup_minimal_symbol (dot_fn.minsym->linkage_name () + 1,
dot_fn_section->objfile); dot_fn_section->objfile);
if (fn.minsym == NULL) if (fn.minsym == NULL)
return 0; return 0;

View File

@@ -99,7 +99,7 @@ ps_pglobal_lookup (struct ps_prochandle *ph, const char *obj,
set_current_program_space (inf->pspace); set_current_program_space (inf->pspace);
/* FIXME: kettenis/2000-09-03: What should we do with OBJ? */ /* FIXME: kettenis/2000-09-03: What should we do with OBJ? */
bound_minimal_symbol ms = lookup_minimal_symbol (name, NULL, NULL); bound_minimal_symbol ms = lookup_minimal_symbol (name);
if (ms.minsym == NULL) if (ms.minsym == NULL)
return PS_NOSYM; return PS_NOSYM;

View File

@@ -329,14 +329,13 @@ ravenscar_thread_target::add_active_thread ()
static bound_minimal_symbol static bound_minimal_symbol
get_running_thread_msymbol () get_running_thread_msymbol ()
{ {
bound_minimal_symbol msym bound_minimal_symbol msym = lookup_minimal_symbol (running_thread_name);
= lookup_minimal_symbol (running_thread_name, NULL, NULL);
if (!msym.minsym) if (!msym.minsym)
/* Older versions of the GNAT runtime were using a different /* Older versions of the GNAT runtime were using a different
(less ideal) name for the symbol where the active thread ID (less ideal) name for the symbol where the active thread ID
is stored. If we couldn't find the symbol using the latest is stored. If we couldn't find the symbol using the latest
name, then try the old one. */ name, then try the old one. */
msym = lookup_minimal_symbol ("running_thread", NULL, NULL); msym = lookup_minimal_symbol ("running_thread");
return msym; return msym;
} }
@@ -348,11 +347,11 @@ static bool
has_ravenscar_runtime () has_ravenscar_runtime ()
{ {
bound_minimal_symbol msym_ravenscar_runtime_initializer bound_minimal_symbol msym_ravenscar_runtime_initializer
= lookup_minimal_symbol (ravenscar_runtime_initializer, NULL, NULL); = lookup_minimal_symbol (ravenscar_runtime_initializer);
bound_minimal_symbol msym_known_tasks bound_minimal_symbol msym_known_tasks
= lookup_minimal_symbol (known_tasks_name, NULL, NULL); = lookup_minimal_symbol (known_tasks_name);
bound_minimal_symbol msym_first_task bound_minimal_symbol msym_first_task
= lookup_minimal_symbol (first_task_name, NULL, NULL); = lookup_minimal_symbol (first_task_name);
bound_minimal_symbol msym_running_thread = get_running_thread_msymbol (); bound_minimal_symbol msym_running_thread = get_running_thread_msymbol ();
return (msym_ravenscar_runtime_initializer.minsym return (msym_ravenscar_runtime_initializer.minsym

View File

@@ -5508,8 +5508,7 @@ remote_target::remote_check_symbols ()
end = hex2bin (tmp, reinterpret_cast <gdb_byte *> (msg.data ()), end = hex2bin (tmp, reinterpret_cast <gdb_byte *> (msg.data ()),
strlen (tmp) / 2); strlen (tmp) / 2);
msg[end] = '\0'; msg[end] = '\0';
bound_minimal_symbol sym bound_minimal_symbol sym = lookup_minimal_symbol (msg.data ());
= lookup_minimal_symbol (msg.data (), NULL, NULL);
if (sym.minsym == NULL) if (sym.minsym == NULL)
xsnprintf (msg.data (), get_remote_packet_size (), "qSymbol::%s", xsnprintf (msg.data (), get_remote_packet_size (), "qSymbol::%s",
&reply[8]); &reply[8]);

View File

@@ -759,7 +759,7 @@ ps_err_e
ps_pglobal_lookup (struct ps_prochandle *ph, const char *ld_object_name, ps_pglobal_lookup (struct ps_prochandle *ph, const char *ld_object_name,
const char *ld_symbol_name, psaddr_t *ld_symbol_addr) const char *ld_symbol_name, psaddr_t *ld_symbol_addr)
{ {
bound_minimal_symbol ms = lookup_minimal_symbol (ld_symbol_name, NULL, NULL); bound_minimal_symbol ms = lookup_minimal_symbol (ld_symbol_name);
if (!ms.minsym) if (!ms.minsym)
return PS_NOSYM; return PS_NOSYM;

View File

@@ -63,7 +63,7 @@ sol2_sigtramp_p (const frame_info_ptr &this_frame)
static CORE_ADDR static CORE_ADDR
sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{ {
bound_minimal_symbol msym = lookup_minimal_symbol ("elf_bndr", NULL, NULL); bound_minimal_symbol msym = lookup_minimal_symbol ("elf_bndr");
if (msym.minsym && msym.value_address () == pc) if (msym.minsym && msym.value_address () == pc)
return frame_unwind_caller_pc (get_current_frame ()); return frame_unwind_caller_pc (get_current_frame ());

View File

@@ -451,7 +451,7 @@ lm_base (void)
return info->lm_base_cache; return info->lm_base_cache;
bound_minimal_symbol got_sym bound_minimal_symbol got_sym
= lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_",
current_program_space->symfile_object_file); current_program_space->symfile_object_file);
if (got_sym.minsym != 0) if (got_sym.minsym != 0)

View File

@@ -280,7 +280,7 @@ lm_base (void)
return lm_base_cache; return lm_base_cache;
bound_minimal_symbol got_sym bound_minimal_symbol got_sym
= lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_",
current_program_space->symfile_object_file); current_program_space->symfile_object_file);
if (got_sym.minsym == 0) if (got_sym.minsym == 0)
{ {
@@ -842,7 +842,7 @@ main_got (void)
{ {
objfile *objf = current_program_space->symfile_object_file; objfile *objf = current_program_space->symfile_object_file;
bound_minimal_symbol got_sym bound_minimal_symbol got_sym
= lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, objf); = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", objf);
if (got_sym.minsym == 0) if (got_sym.minsym == 0)
return 0; return 0;

View File

@@ -751,7 +751,7 @@ elf_locate_base (void)
/* This may be a static executable. Look for the symbol /* This may be a static executable. Look for the symbol
conventionally named _r_debug, as a last resort. */ conventionally named _r_debug, as a last resort. */
bound_minimal_symbol msymbol bound_minimal_symbol msymbol
= lookup_minimal_symbol ("_r_debug", NULL, = lookup_minimal_symbol ("_r_debug",
current_program_space->symfile_object_file); current_program_space->symfile_object_file);
if (msymbol.minsym != NULL) if (msymbol.minsym != NULL)
return msymbol.value_address (); return msymbol.value_address ();
@@ -2481,8 +2481,7 @@ enable_break (struct svr4_info *info, int from_tty)
objfile *objf = current_program_space->symfile_object_file; objfile *objf = current_program_space->symfile_object_file;
for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++) for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++)
{ {
bound_minimal_symbol msymbol bound_minimal_symbol msymbol = lookup_minimal_symbol (*bkpt_namep, objf);
= lookup_minimal_symbol (*bkpt_namep, NULL, objf);
if ((msymbol.minsym != NULL) if ((msymbol.minsym != NULL)
&& (msymbol.value_address () != 0)) && (msymbol.value_address () != 0))
{ {
@@ -2502,7 +2501,7 @@ enable_break (struct svr4_info *info, int from_tty)
for (bkpt_namep = bkpt_names; *bkpt_namep != NULL; bkpt_namep++) for (bkpt_namep = bkpt_names; *bkpt_namep != NULL; bkpt_namep++)
{ {
bound_minimal_symbol msymbol bound_minimal_symbol msymbol
= lookup_minimal_symbol (*bkpt_namep, NULL, objf); = lookup_minimal_symbol (*bkpt_namep, objf);
if ((msymbol.minsym != NULL) if ((msymbol.minsym != NULL)
&& (msymbol.value_address () != 0)) && (msymbol.value_address () != 0))
{ {

View File

@@ -3433,8 +3433,7 @@ simple_read_overlay_table (void)
enum bfd_endian byte_order; enum bfd_endian byte_order;
simple_free_overlay_table (); simple_free_overlay_table ();
bound_minimal_symbol novlys_msym bound_minimal_symbol novlys_msym = lookup_minimal_symbol ("_novlys");
= lookup_minimal_symbol ("_novlys", NULL, NULL);
if (! novlys_msym.minsym) if (! novlys_msym.minsym)
{ {
error (_("Error reading inferior's overlay table: " error (_("Error reading inferior's overlay table: "
@@ -3523,8 +3522,7 @@ simple_overlay_update (struct obj_section *osect)
{ {
/* Does its cached location match what's currently in the /* Does its cached location match what's currently in the
symtab? */ symtab? */
bound_minimal_symbol minsym bound_minimal_symbol minsym = lookup_minimal_symbol ("_ovly_table");
= lookup_minimal_symbol ("_ovly_table", NULL, NULL);
if (minsym.minsym == NULL) if (minsym.minsym == NULL)
error (_("Error reading inferior's overlay table: couldn't " error (_("Error reading inferior's overlay table: couldn't "

View File

@@ -2580,8 +2580,7 @@ info_scope_command (const char *args_in, int from_tty)
case LOC_UNRESOLVED: case LOC_UNRESOLVED:
{ {
bound_minimal_symbol msym bound_minimal_symbol msym
= lookup_minimal_symbol (sym->linkage_name (), NULL, = lookup_minimal_symbol (sym->linkage_name ());
NULL);
if (msym.minsym == NULL) if (msym.minsym == NULL)
gdb_printf ("Unresolved Static"); gdb_printf ("Unresolved Static");
else else

View File

@@ -403,7 +403,7 @@ tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
if (addr == 0) if (addr == 0)
{ {
bound_minimal_symbol main_symbol bound_minimal_symbol main_symbol
= lookup_minimal_symbol (main_name (), nullptr, nullptr); = lookup_minimal_symbol (main_name ());
if (main_symbol.minsym != nullptr) if (main_symbol.minsym != nullptr)
addr = main_symbol.value_address (); addr = main_symbol.value_address ();
} }

View File

@@ -2988,8 +2988,7 @@ value_static_field (struct type *type, int fieldno)
{ {
/* With some compilers, e.g. HP aCC, static data members are /* With some compilers, e.g. HP aCC, static data members are
reported as non-debuggable symbols. */ reported as non-debuggable symbols. */
bound_minimal_symbol msym bound_minimal_symbol msym = lookup_minimal_symbol (phys_name);
= lookup_minimal_symbol (phys_name, NULL, NULL);
struct type *field_type = type->field (fieldno).type (); struct type *field_type = type->field (fieldno).type ();
if (!msym.minsym) if (!msym.minsym)

View File

@@ -356,8 +356,7 @@ z80_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
/* stage2: check for FP saving scheme */ /* stage2: check for FP saving scheme */
if (prologue[pos] == 0xcd) /* call nn */ if (prologue[pos] == 0xcd) /* call nn */
{ {
bound_minimal_symbol msymbol bound_minimal_symbol msymbol = lookup_minimal_symbol ("__sdcc_enter_ix");
= lookup_minimal_symbol ("__sdcc_enter_ix", NULL, NULL);
if (msymbol.minsym) if (msymbol.minsym)
{ {
value = msymbol.value_address (); value = msymbol.value_address ();
@@ -622,7 +621,7 @@ z80_frame_unwind_cache (const frame_info_ptr &this_frame,
for (i = sizeof(names)/sizeof(*names)-1; i >= 0; --i) for (i = sizeof(names)/sizeof(*names)-1; i >= 0; --i)
{ {
bound_minimal_symbol msymbol bound_minimal_symbol msymbol
= lookup_minimal_symbol (names[i], NULL, NULL); = lookup_minimal_symbol (names[i]);
if (!msymbol.minsym) if (!msymbol.minsym)
continue; continue;
if (addr == msymbol.value_address ()) if (addr == msymbol.value_address ())
@@ -719,8 +718,7 @@ z80_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
static int addr = -1; static int addr = -1;
if (addr == -1) if (addr == -1)
{ {
bound_minimal_symbol bh bound_minimal_symbol bh = lookup_minimal_symbol ("_break_handler");
= lookup_minimal_symbol ("_break_handler", NULL, NULL);
if (bh.minsym) if (bh.minsym)
addr = bh.value_address (); addr = bh.value_address ();
else else
@@ -900,7 +898,7 @@ z80_read_overlay_region_table ()
z80_free_overlay_region_table (); z80_free_overlay_region_table ();
bound_minimal_symbol novly_regions_msym bound_minimal_symbol novly_regions_msym
= lookup_minimal_symbol ("_novly_regions", NULL, NULL); = lookup_minimal_symbol ("_novly_regions");
if (! novly_regions_msym.minsym) if (! novly_regions_msym.minsym)
{ {
error (_("Error reading inferior's overlay table: " error (_("Error reading inferior's overlay table: "