diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2024-07-16 23:52:00 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2024-08-12 10:31:09 -0400 |
commit | c8979ae4fbcc2b84b4192d0596597c3352fa430b (patch) | |
tree | f5a24bbbe6ab8b3aee270ce5bb586933371fae93 /gdb | |
parent | 03b40f6f55bed82bd16b2a1fd94fb8c8dbf797bf (diff) | |
download | gdb-c8979ae4fbcc2b84b4192d0596597c3352fa430b.zip gdb-c8979ae4fbcc2b84b4192d0596597c3352fa430b.tar.gz gdb-c8979ae4fbcc2b84b4192d0596597c3352fa430b.tar.bz2 |
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>
Diffstat (limited to 'gdb')
57 files changed, 104 insertions, 133 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index e0f895c..972c756 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -806,7 +806,7 @@ ada_main_name () that string, then most probably the main procedure is not written in Ada. */ 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) { @@ -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 a specific exception). We do not handle this case for now. */ 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) 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) { 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) error (_("Your Ada runtime appears to be missing some debugging " diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index 745e2af..72a1399 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -920,8 +920,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) /* Try array. */ - bound_minimal_symbol msym - = lookup_minimal_symbol (KNOWN_TASKS_NAME, NULL, NULL); + bound_minimal_symbol msym = lookup_minimal_symbol (KNOWN_TASKS_NAME); if (msym.minsym != NULL) { data->known_tasks_kind = ADA_TASKS_ARRAY; @@ -968,7 +967,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) /* Try list. */ - msym = lookup_minimal_symbol (KNOWN_TASKS_LIST, NULL, NULL); + msym = lookup_minimal_symbol (KNOWN_TASKS_LIST); if (msym.minsym != NULL) { data->known_tasks_kind = ADA_TASKS_LIST; diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 4c3df9c..847c900 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -395,7 +395,7 @@ pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, int co symbols[i].addr = 0; else { - bound_minimal_symbol ms = lookup_minimal_symbol (name, NULL, NULL); + bound_minimal_symbol ms = lookup_minimal_symbol (name); if (ms.minsym == NULL) { if (debug_aix_thread) @@ -978,7 +978,7 @@ pd_enable (inferior *inf) return; /* 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) return; data->pd_brk_addr = ms.value_address (); diff --git a/gdb/arc-linux-tdep.c b/gdb/arc-linux-tdep.c index bbb8c07..d71c5bf 100644 --- a/gdb/arc-linux-tdep.c +++ b/gdb/arc-linux-tdep.c @@ -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, gdb sets a breakpoint at the return address, and continues. */ - bound_minimal_symbol resolver - = lookup_minimal_symbol ("_dl_linux_resolver", NULL, NULL); + bound_minimal_symbol resolver = lookup_minimal_symbol ("_dl_linux_resolver"); if (arc_debug) { diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 6278113..f3db289 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -9388,8 +9388,7 @@ arm_skip_cmse_entry (CORE_ADDR pc, const char *name, struct objfile *objfile) char *target_name = (char *) alloca (target_len); xsnprintf (target_name, target_len, "%s%s", "__acle_se_", name); - bound_minimal_symbol minsym - = lookup_minimal_symbol (target_name, NULL, objfile); + bound_minimal_symbol minsym = lookup_minimal_symbol (target_name, objfile); if (minsym.minsym != nullptr) return minsym.value_address (); @@ -9478,7 +9477,7 @@ arm_skip_stub (const frame_info_ptr &frame, CORE_ADDR pc) sec = find_pc_section (pc); objfile = (sec == NULL) ? NULL : sec->objfile; bound_minimal_symbol minsym - = lookup_minimal_symbol (target_name, NULL, objfile); + = lookup_minimal_symbol (target_name, objfile); if (minsym.minsym != NULL) return minsym.value_address (); else @@ -90,7 +90,7 @@ ld_so_xfer_auxv (gdb_byte *readbuf, LONGEST retval; 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) return TARGET_XFER_E_IO; diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 690ecae..dc1eb61 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -623,7 +623,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end, pc_offset += 2; bound_minimal_symbol msymbol - = lookup_minimal_symbol ("__prologue_saves__", NULL, NULL); + = lookup_minimal_symbol ("__prologue_saves__"); if (!msymbol.minsym) break; diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 899abb9..db4dcc2 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -599,7 +599,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var) case LOC_UNRESOLVED: { bound_minimal_symbol msym - = lookup_minimal_symbol (var->linkage_name (), NULL, NULL); + = lookup_minimal_symbol (var->linkage_name ()); if (!msym.minsym) error (_("Couldn't resolve symbol `%s'."), var->print_name ()); diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index a8f67e7..71da724 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3752,7 +3752,7 @@ create_std_terminate_master_breakpoint (void) if (bp_objfile_data->terminate_msym.minsym == NULL) { 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 && m.minsym->type () != mst_file_text)) { diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c index ecb12ad..d5beba2 100644 --- a/gdb/bsd-uthread.c +++ b/gdb/bsd-uthread.c @@ -157,7 +157,7 @@ static int bsd_uthread_active; static CORE_ADDR 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) return sym.value_address (); diff --git a/gdb/c-exp.y b/gdb/c-exp.y index a1a74a9..9240552 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -3150,7 +3150,7 @@ classify_name (struct parser_state *par_state, const struct block *block, if (bsym.symbol == NULL && par_state->language ()->la_language == language_cplus && 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 NAME; diff --git a/gdb/coffread.c b/gdb/coffread.c index d4bc7d6..be1e21e 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -579,7 +579,7 @@ coff_read_minsyms (file_ptr symtab_offset, unsigned int nsyms, name1 += 1; 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" respectively in OBJFILE. Set the type of symbol "foo" diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c index 5e602b9..1dffa6b 100644 --- a/gdb/compile/compile-c-symbols.c +++ b/gdb/compile/compile-c-symbols.c @@ -355,8 +355,7 @@ gcc_convert_symbol (void *datum, } else if (request == GCC_C_ORACLE_SYMBOL) { - bound_minimal_symbol bmsym - = lookup_minimal_symbol (identifier, NULL, NULL); + bound_minimal_symbol bmsym = lookup_minimal_symbol (identifier); if (bmsym.minsym != NULL) { convert_symbol_bmsym (context, bmsym); diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c index 6485632..cb69086 100644 --- a/gdb/compile/compile-object-load.c +++ b/gdb/compile/compile-object-load.c @@ -764,8 +764,7 @@ compile_object_load (const compile_file_names &file_names, continue; } - bound_minimal_symbol bmsym - = lookup_minimal_symbol (sym->name, NULL, NULL); + bound_minimal_symbol bmsym = lookup_minimal_symbol (sym->name); switch (bmsym.minsym == NULL ? mst_unknown : bmsym.minsym->type ()) { diff --git a/gdb/ctfread.c b/gdb/ctfread.c index 42009dc..eb7cf31 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -323,7 +323,7 @@ get_bitsize (ctf_dict_t *fp, ctf_id_t tid, uint32_t kind) static void 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) { sym->set_value_address (msym.value_address ()); diff --git a/gdb/d-lang.c b/gdb/d-lang.c index 0a9e9b0..11c5c03 100644 --- a/gdb/d-lang.c +++ b/gdb/d-lang.c @@ -38,7 +38,7 @@ static const char D_MAIN[] = "D main"; const char * 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) return D_MAIN; diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 47e56d4..4b2a7d2 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -907,7 +907,7 @@ find_stab_function (const char *namestring, const char *filename, strncpy (p, namestring, n); 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) { /* 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. */ p[n] = '_'; p[n + 1] = 0; - msym = lookup_minimal_symbol (p, filename, objfile); + msym = lookup_minimal_symbol (p, objfile, filename); } if (msym.minsym == NULL && filename != NULL) { /* Try again without the filename. */ p[n] = 0; - msym = lookup_minimal_symbol (p, NULL, objfile); + msym = lookup_minimal_symbol (p, objfile); } if (msym.minsym == NULL && filename != NULL) { /* And try again for Sun Fortran, but without the filename. */ p[n] = '_'; p[n + 1] = 0; - msym = lookup_minimal_symbol (p, NULL, objfile); + msym = lookup_minimal_symbol (p, objfile); } return msym; @@ -2044,7 +2044,7 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs, p[n] = 0; bound_minimal_symbol minsym - = lookup_minimal_symbol (p, pst->filename, objfile); + = lookup_minimal_symbol (p, objfile, pst->filename); if (minsym.minsym == NULL) { /* 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. */ p[n] = '_'; p[n + 1] = 0; - minsym = lookup_minimal_symbol (p, pst->filename, objfile); + minsym = lookup_minimal_symbol (p, objfile, pst->filename); } if (minsym.minsym) diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 57a4706..06e57be 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -710,8 +710,7 @@ call_site_target::iterate_over_addresses (gdbarch *call_site_gdbarch, physname = m_loc.physname; /* Handle both the mangled and demangled PHYSNAME. */ - bound_minimal_symbol msym - = lookup_minimal_symbol (physname, NULL, NULL); + bound_minimal_symbol msym = lookup_minimal_symbol (physname); if (msym.minsym == NULL) { msym = lookup_minimal_symbol_by_pc (call_site->pc () - 1); diff --git a/gdb/elfread.c b/gdb/elfread.c index c82e150..68b45ef 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -842,9 +842,9 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p) CORE_ADDR pointer_address, addr; asection *plt; 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) return 0; if (msym.minsym->type () != mst_slot_got_plt) @@ -1954,7 +1954,7 @@ eval_op_objc_msgcall (struct type *expect_type, struct expression *exp, if (value_as_long (target) == 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; /* Find the method dispatch (Apple runtime) or method lookup diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c index 6b0d502..cba460b 100644 --- a/gdb/fbsd-tdep.c +++ b/gdb/fbsd-tdep.c @@ -1943,7 +1943,7 @@ fbsd_get_syscall_number (struct gdbarch *gdbarch, thread_info *thread) static LONGEST 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) error (_("Unable to resolve symbol '%s'"), name); diff --git a/gdb/findvar.c b/gdb/findvar.c index df4ab1a..c67315f 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -449,8 +449,7 @@ language_defn::read_var_value (struct symbol *var, (var->arch (), [var, &bmsym] (objfile *objfile) { - bmsym = lookup_minimal_symbol (var->linkage_name (), nullptr, - objfile); + bmsym = lookup_minimal_symbol (var->linkage_name (), objfile); /* Stop if a match is found. */ return bmsym.minsym != nullptr; diff --git a/gdb/frame.c b/gdb/frame.c index e6ab547..8c30979 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -2584,8 +2584,7 @@ inside_main_func (const frame_info_ptr &this_frame) CORE_ADDR sym_addr = 0; const char *name = main_name (); bound_minimal_symbol msymbol - = lookup_minimal_symbol (name, NULL, - current_program_space->symfile_object_file); + = lookup_minimal_symbol (name, current_program_space->symfile_object_file); if (msymbol.minsym != nullptr) sym_addr = msymbol.value_address (); diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index b1f79f3..80cc546 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -1379,8 +1379,7 @@ frv_frame_this_id (const frame_info_ptr &this_frame, func = get_frame_func (this_frame); /* Check if the stack is empty. */ - bound_minimal_symbol msym_stack - = lookup_minimal_symbol ("_stack", NULL, NULL); + bound_minimal_symbol msym_stack = lookup_minimal_symbol ("_stack"); if (msym_stack.minsym && info->base == msym_stack.value_address ()) return; diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c index e34a619..00dd763 100644 --- a/gdb/ft32-tdep.c +++ b/gdb/ft32-tdep.c @@ -195,8 +195,7 @@ ft32_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, snprintf (prolog_symbol, sizeof (prolog_symbol), "__prolog_$r%02d", regnum); - bound_minimal_symbol msymbol - = lookup_minimal_symbol (prolog_symbol, NULL, NULL); + bound_minimal_symbol msymbol = lookup_minimal_symbol (prolog_symbol); if (msymbol.minsym) prologs[regnum] = msymbol.value_address (); else diff --git a/gdb/gcore.c b/gdb/gcore.c index 2ab00a0..0f04679 100644 --- a/gdb/gcore.c +++ b/gdb/gcore.c @@ -269,13 +269,13 @@ call_target_sbrk (int sbrk_arg) struct value *sbrk_fn, *ret; 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); if (sbrk_fn == NULL) 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); if (sbrk_fn == NULL) diff --git a/gdb/glibc-tdep.c b/gdb/glibc-tdep.c index 0ade1df..493645d 100644 --- a/gdb/glibc-tdep.c +++ b/gdb/glibc-tdep.c @@ -59,11 +59,11 @@ glibc_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { /* The dynamic linker began using this name in early 2005. */ 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. */ 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) return frame_unwind_caller_pc (get_current_frame ()); diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index 92735b9..70cdde3 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -1160,8 +1160,7 @@ gnuv3_get_typeid (struct value *value) else { std::string sym_name = std::string ("typeinfo for ") + name; - bound_minimal_symbol minsym - = lookup_minimal_symbol (sym_name.c_str (), NULL, NULL); + bound_minimal_symbol minsym = lookup_minimal_symbol (sym_name.c_str ()); if (minsym.minsym == NULL) 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 "); 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) return 0; diff --git a/gdb/go-lang.c b/gdb/go-lang.c index bbf4479..cf1f5a9 100644 --- a/gdb/go-lang.c +++ b/gdb/go-lang.c @@ -54,7 +54,7 @@ static const char GO_MAIN_MAIN[] = "main.main"; const char * 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) return GO_MAIN_MAIN; diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 43cf46b..0ce754a 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -194,7 +194,7 @@ hppa_extract_17 (unsigned word) CORE_ADDR 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) return minsym.value_address (); else diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index e34c5e0..d36511b 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -484,10 +484,9 @@ inferior_call_waitpid (ptid_t pptid, int pid) scoped_switch_fork_info switch_fork_info (pptid); /* 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); - if (!waitpid_fn - && lookup_minimal_symbol ("_waitpid", NULL, NULL).minsym != NULL) + if (!waitpid_fn && lookup_minimal_symbol ("_waitpid").minsym != nullptr) waitpid_fn = find_function_in_inferior ("_waitpid", &waitpid_objf); 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. */ - 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); 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); if (!fork_fn) error (_("checkpoint: can't find fork function in inferior.")); diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 0a63957..6abaa20 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -470,8 +470,7 @@ inferior_has_bug (const char *ver_symbol, int ver_major_min, int ver_minor_min) CORE_ADDR version_addr; int got, retval = 0; - bound_minimal_symbol version_msym - = lookup_minimal_symbol (ver_symbol, NULL, NULL); + bound_minimal_symbol version_msym = lookup_minimal_symbol (ver_symbol); if (version_msym.minsym == NULL) return 0; @@ -810,9 +809,7 @@ static bool libpthread_objfile_p (objfile *obj) { return (libpthread_name_p (objfile_name (obj)) - && lookup_minimal_symbol ("pthread_create", - NULL, - obj).minsym != NULL); + && lookup_minimal_symbol ("pthread_create", obj).minsym != nullptr); } /* Attempt to initialize dlopen()ed libthread_db, described by INFO. diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index db859bc..3531fbb 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -2212,8 +2212,7 @@ m32c_return_value (struct gdbarch *gdbarch, /* 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. */ - bound_minimal_symbol mem0 - = lookup_minimal_symbol ("mem0", NULL, NULL); + bound_minimal_symbol mem0 = lookup_minimal_symbol ("mem0"); if (! mem0.minsym) 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 needed. This is not what the Renesas tools do, but it's what GCC does at the moment. */ - bound_minimal_symbol mem0 - = lookup_minimal_symbol ("mem0", NULL, NULL); + bound_minimal_symbol mem0 = lookup_minimal_symbol ("mem0"); if (! mem0.minsym) 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"); /* Try to find a linker symbol for the trampoline. */ - bound_minimal_symbol tramp_msym - = lookup_minimal_symbol (tramp_name, NULL, NULL); + bound_minimal_symbol tramp_msym = lookup_minimal_symbol (tramp_name); /* We've either got another copy of the name now, or don't need the name any more. */ @@ -2521,7 +2518,7 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch, memcpy (func_name, ptr_msym_name, len - 4); func_name[len - 4] = '\0'; 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 function's true address. */ diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index b41d8a5..4899c15 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -806,8 +806,7 @@ m32r_frame_this_id (const frame_info_ptr &this_frame, func = get_frame_func (this_frame); /* Check if the stack is empty. */ - bound_minimal_symbol msym_stack - = lookup_minimal_symbol ("_stack", NULL, NULL); + bound_minimal_symbol msym_stack = lookup_minimal_symbol ("_stack"); if (msym_stack.minsym && info->base == msym_stack.value_address ()) return; diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 4093d2b..8075dbb 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -210,7 +210,7 @@ static int soft_reg_initialized = 0; static void 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) { reg->addr = msymbol.value_address (); diff --git a/gdb/machoread.c b/gdb/machoread.c index 2f2874a..5840b66 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c @@ -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; - 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) { warning (_("can't find symbol '%s' in minsymtab"), name); diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 49381dd..bc6ab51 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -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. */ bound_minimal_symbol -lookup_minimal_symbol (const char *name, const char *sfile, - struct objfile *objf) +lookup_minimal_symbol (const char *name, objfile *objf, const char *sfile) { found_minimal_symbols found; @@ -479,7 +478,7 @@ lookup_minimal_symbol (const char *name, const char *sfile, bound_minimal_symbol lookup_bound_minimal_symbol (const char *name) { - return lookup_minimal_symbol (name, NULL, NULL); + return lookup_minimal_symbol (name); } /* See gdbsupport/symbol.h. */ @@ -488,7 +487,7 @@ int find_minimal_symbol_address (const char *name, CORE_ADDR *addr, 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) *addr = sym.value_address (); diff --git a/gdb/minsyms.h b/gdb/minsyms.h index ab80c29..f8d4117 100644 --- a/gdb/minsyms.h +++ b/gdb/minsyms.h @@ -205,8 +205,9 @@ unsigned int msymbol_hash_iw (const char *); symbols are still preferred). Returns a bound minimal symbol that matches, or an empty bound minimal symbol if no match is found. */ -bound_minimal_symbol lookup_minimal_symbol (const char *, const char *, - struct objfile *); +bound_minimal_symbol lookup_minimal_symbol (const char *name, + objfile *obj = nullptr, + const char *sfile = nullptr); /* Like lookup_minimal_symbol, but searches all files and objfiles. */ diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index 18ef979..dd37d2c 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -700,7 +700,7 @@ static CORE_ADDR mips_linux_skip_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { 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) return frame_unwind_caller_pc (get_current_frame ()); diff --git a/gdb/netbsd-tdep.c b/gdb/netbsd-tdep.c index 18155a2..4d2c412 100644 --- a/gdb/netbsd-tdep.c +++ b/gdb/netbsd-tdep.c @@ -348,8 +348,7 @@ nbsd_gdb_signal_to_target (struct gdbarch *gdbarch, static CORE_ADDR nbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { - bound_minimal_symbol msym - = lookup_minimal_symbol ("_rtld_bind_start", NULL, NULL); + bound_minimal_symbol msym = lookup_minimal_symbol ("_rtld_bind_start"); if (msym.minsym && msym.value_address () == pc) return frame_unwind_caller_pc (get_current_frame ()); else diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index fc1d81c..1054297 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -120,9 +120,9 @@ lookup_objc_class (struct gdbarch *gdbarch, const char *classname) 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); - 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); else { @@ -149,9 +149,9 @@ lookup_child_selector (struct gdbarch *gdbarch, const char *selname) 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); - 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); 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_coerce_array(stringValue[2]); /* _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); 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); 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 = 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 ()); else { - bound_minimal_symbol msym = lookup_minimal_symbol (selector, 0, 0); + bound_minimal_symbol msym = lookup_minimal_symbol (selector); if (msym.minsym != NULL) symbol_names->push_back (msym.minsym->natural_name ()); diff --git a/gdb/obsd-tdep.c b/gdb/obsd-tdep.c index fab05b7..755e612 100644 --- a/gdb/obsd-tdep.c +++ b/gdb/obsd-tdep.c @@ -27,7 +27,7 @@ CORE_ADDR 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) return frame_unwind_caller_pc (get_current_frame ()); else diff --git a/gdb/p-lang.c b/gdb/p-lang.c index 9a8a35d..70f28c9 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -59,21 +59,20 @@ static const char GPC_MAIN_PROGRAM_NAME_2[] = "pascal_main_program"; const char * pascal_main_name (void) { - bound_minimal_symbol msym - = lookup_minimal_symbol (GPC_P_INITIALIZE, NULL, NULL); + bound_minimal_symbol msym = lookup_minimal_symbol (GPC_P_INITIALIZE); /* If '_p_initialize' was not found, the main program is likely not written in Pascal. */ if (msym.minsym == 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) { 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) { return GPC_MAIN_PROGRAM_NAME_2; diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index 041f83d..cdba46c 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -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) contain a minimal symbol with the same name. */ 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); if (fn.minsym == NULL) return 0; diff --git a/gdb/proc-service.c b/gdb/proc-service.c index 1889a00..bf57efd 100644 --- a/gdb/proc-service.c +++ b/gdb/proc-service.c @@ -99,7 +99,7 @@ ps_pglobal_lookup (struct ps_prochandle *ph, const char *obj, set_current_program_space (inf->pspace); /* 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) return PS_NOSYM; diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index 9100a2c..68c2978 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -329,14 +329,13 @@ ravenscar_thread_target::add_active_thread () static bound_minimal_symbol get_running_thread_msymbol () { - bound_minimal_symbol msym - = lookup_minimal_symbol (running_thread_name, NULL, NULL); + bound_minimal_symbol msym = lookup_minimal_symbol (running_thread_name); 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 name, then try the old one. */ - msym = lookup_minimal_symbol ("running_thread", NULL, NULL); + msym = lookup_minimal_symbol ("running_thread"); return msym; } @@ -348,11 +347,11 @@ static bool has_ravenscar_runtime () { 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 - = lookup_minimal_symbol (known_tasks_name, NULL, NULL); + = lookup_minimal_symbol (known_tasks_name); 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 (); return (msym_ravenscar_runtime_initializer.minsym diff --git a/gdb/remote.c b/gdb/remote.c index eab527d..9937b2f 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -5508,8 +5508,7 @@ remote_target::remote_check_symbols () end = hex2bin (tmp, reinterpret_cast <gdb_byte *> (msg.data ()), strlen (tmp) / 2); msg[end] = '\0'; - bound_minimal_symbol sym - = lookup_minimal_symbol (msg.data (), NULL, NULL); + bound_minimal_symbol sym = lookup_minimal_symbol (msg.data ()); if (sym.minsym == NULL) xsnprintf (msg.data (), get_remote_packet_size (), "qSymbol::%s", &reply[8]); diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index e09973e..25b6aa3 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -759,7 +759,7 @@ ps_err_e ps_pglobal_lookup (struct ps_prochandle *ph, const char *ld_object_name, 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) return PS_NOSYM; diff --git a/gdb/sol2-tdep.c b/gdb/sol2-tdep.c index b3eb828..3081726 100644 --- a/gdb/sol2-tdep.c +++ b/gdb/sol2-tdep.c @@ -63,7 +63,7 @@ sol2_sigtramp_p (const frame_info_ptr &this_frame) static CORE_ADDR 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) return frame_unwind_caller_pc (get_current_frame ()); diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c index 9840255..6ea9a13 100644 --- a/gdb/solib-dsbt.c +++ b/gdb/solib-dsbt.c @@ -451,7 +451,7 @@ lm_base (void) return info->lm_base_cache; bound_minimal_symbol got_sym - = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, + = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", current_program_space->symfile_object_file); if (got_sym.minsym != 0) diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c index 062a29f..b10d030 100644 --- a/gdb/solib-frv.c +++ b/gdb/solib-frv.c @@ -280,7 +280,7 @@ lm_base (void) return lm_base_cache; bound_minimal_symbol got_sym - = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, + = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", current_program_space->symfile_object_file); if (got_sym.minsym == 0) { @@ -842,7 +842,7 @@ main_got (void) { objfile *objf = current_program_space->symfile_object_file; 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) return 0; diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 4633757..666e173 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -751,7 +751,7 @@ elf_locate_base (void) /* This may be a static executable. Look for the symbol conventionally named _r_debug, as a last resort. */ bound_minimal_symbol msymbol - = lookup_minimal_symbol ("_r_debug", NULL, + = lookup_minimal_symbol ("_r_debug", current_program_space->symfile_object_file); if (msymbol.minsym != NULL) 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; for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++) { - bound_minimal_symbol msymbol - = lookup_minimal_symbol (*bkpt_namep, NULL, objf); + bound_minimal_symbol msymbol = lookup_minimal_symbol (*bkpt_namep, objf); if ((msymbol.minsym != NULL) && (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++) { bound_minimal_symbol msymbol - = lookup_minimal_symbol (*bkpt_namep, NULL, objf); + = lookup_minimal_symbol (*bkpt_namep, objf); if ((msymbol.minsym != NULL) && (msymbol.value_address () != 0)) { diff --git a/gdb/symfile.c b/gdb/symfile.c index b2d0b0f..7643329 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -3433,8 +3433,7 @@ simple_read_overlay_table (void) enum bfd_endian byte_order; simple_free_overlay_table (); - bound_minimal_symbol novlys_msym - = lookup_minimal_symbol ("_novlys", NULL, NULL); + bound_minimal_symbol novlys_msym = lookup_minimal_symbol ("_novlys"); if (! novlys_msym.minsym) { 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 symtab? */ - bound_minimal_symbol minsym - = lookup_minimal_symbol ("_ovly_table", NULL, NULL); + bound_minimal_symbol minsym = lookup_minimal_symbol ("_ovly_table"); if (minsym.minsym == NULL) error (_("Error reading inferior's overlay table: couldn't " diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index f955557..2f2366b 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2580,8 +2580,7 @@ info_scope_command (const char *args_in, int from_tty) case LOC_UNRESOLVED: { bound_minimal_symbol msym - = lookup_minimal_symbol (sym->linkage_name (), NULL, - NULL); + = lookup_minimal_symbol (sym->linkage_name ()); if (msym.minsym == NULL) gdb_printf ("Unresolved Static"); else diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 6ec8216..c37c20e 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -403,7 +403,7 @@ tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p) if (addr == 0) { bound_minimal_symbol main_symbol - = lookup_minimal_symbol (main_name (), nullptr, nullptr); + = lookup_minimal_symbol (main_name ()); if (main_symbol.minsym != nullptr) addr = main_symbol.value_address (); } diff --git a/gdb/value.c b/gdb/value.c index b83e550..45038fb 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -2988,8 +2988,7 @@ value_static_field (struct type *type, int fieldno) { /* With some compilers, e.g. HP aCC, static data members are reported as non-debuggable symbols. */ - bound_minimal_symbol msym - = lookup_minimal_symbol (phys_name, NULL, NULL); + bound_minimal_symbol msym = lookup_minimal_symbol (phys_name); struct type *field_type = type->field (fieldno).type (); if (!msym.minsym) diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c index e290b65..f04724f 100644 --- a/gdb/z80-tdep.c +++ b/gdb/z80-tdep.c @@ -356,8 +356,7 @@ z80_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end, /* stage2: check for FP saving scheme */ if (prologue[pos] == 0xcd) /* call nn */ { - bound_minimal_symbol msymbol - = lookup_minimal_symbol ("__sdcc_enter_ix", NULL, NULL); + bound_minimal_symbol msymbol = lookup_minimal_symbol ("__sdcc_enter_ix"); if (msymbol.minsym) { 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) { bound_minimal_symbol msymbol - = lookup_minimal_symbol (names[i], NULL, NULL); + = lookup_minimal_symbol (names[i]); if (!msymbol.minsym) continue; if (addr == msymbol.value_address ()) @@ -719,8 +718,7 @@ z80_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr) static int addr = -1; if (addr == -1) { - bound_minimal_symbol bh - = lookup_minimal_symbol ("_break_handler", NULL, NULL); + bound_minimal_symbol bh = lookup_minimal_symbol ("_break_handler"); if (bh.minsym) addr = bh.value_address (); else @@ -900,7 +898,7 @@ z80_read_overlay_region_table () z80_free_overlay_region_table (); bound_minimal_symbol novly_regions_msym - = lookup_minimal_symbol ("_novly_regions", NULL, NULL); + = lookup_minimal_symbol ("_novly_regions"); if (! novly_regions_msym.minsym) { error (_("Error reading inferior's overlay table: " |