From: Simon Marchi Date: Wed, 17 Jul 2024 03:52:01 +0000 (-0400) Subject: gdb: remove lookup_bound_minimal_symbol X-Git-Tag: gdb-16-branchpoint~1182 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d2f4b7c3168f79fdef3e50163c91cca43da1381;p=thirdparty%2Fbinutils-gdb.git gdb: remove lookup_bound_minimal_symbol Now that lookup_minimal_symbol has default values for sfile and objf, calling lookup_bound_minimal_symbol is identical to calling lookup_minimal_symbol without sfile and objf. Remove lookup_bound_minimal_symbol, replace call sites with lookup_minimal_symbol. Change-Id: I0a420fb56de1de8bee8a7303228c9e4546e3577b Reviewed-by: Keith Seitz Approved-By: Andrew Burgess --- diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index 72a1399369e..43a63f86355 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -600,7 +600,7 @@ ada_get_tcb_types_info (void) /* Check for the CPU offset. */ bound_minimal_symbol first_id_sym - = lookup_bound_minimal_symbol ("__gnat_gdb_cpu_first_id"); + = lookup_minimal_symbol ("__gnat_gdb_cpu_first_id"); unsigned int first_id = 0; if (first_id_sym.minsym != nullptr) { diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 9240552db93..a06a00007bc 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -1210,7 +1210,7 @@ variable: name_not_typename std::string arg = copy_name ($1.stoken); bound_minimal_symbol msymbol - = lookup_bound_minimal_symbol (arg.c_str ()); + = lookup_minimal_symbol (arg.c_str ()); if (msymbol.minsym == NULL) { if (!have_full_symbols (current_program_space) diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c index 9d087212b8c..9cfa1a37297 100644 --- a/gdb/coff-pe-read.c +++ b/gdb/coff-pe-read.c @@ -183,14 +183,14 @@ add_pe_forwarded_sym (minimal_symbol_reader &reader, forward_func_name); bound_minimal_symbol msymbol - = lookup_bound_minimal_symbol (forward_qualified_name.c_str ()); + = lookup_minimal_symbol (forward_qualified_name.c_str ()); if (!msymbol.minsym) { int i; for (i = 0; i < forward_dll_name_len; i++) forward_qualified_name[i] = tolower (forward_qualified_name[i]); - msymbol = lookup_bound_minimal_symbol (forward_qualified_name.c_str ()); + msymbol = lookup_minimal_symbol (forward_qualified_name.c_str ()); } if (!msymbol.minsym) diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c index 1dffa6be6ad..e2af722c817 100644 --- a/gdb/compile/compile-c-symbols.c +++ b/gdb/compile/compile-c-symbols.c @@ -410,7 +410,7 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context, } else { - bound_minimal_symbol msym = lookup_bound_minimal_symbol (identifier); + bound_minimal_symbol msym = lookup_minimal_symbol (identifier); if (msym.minsym != NULL) { if (compile_debug) diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplus-symbols.c index 45b965a30fa..7e251a6ef0a 100644 --- a/gdb/compile/compile-cplus-symbols.c +++ b/gdb/compile/compile-cplus-symbols.c @@ -453,7 +453,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context, } else { - bound_minimal_symbol msym = lookup_bound_minimal_symbol (identifier); + bound_minimal_symbol msym = lookup_minimal_symbol (identifier); if (msym.minsym != nullptr) { if (compile_debug) diff --git a/gdb/d-exp.y b/gdb/d-exp.y index f4de994ae4d..9fc63afaa1c 100644 --- a/gdb/d-exp.y +++ b/gdb/d-exp.y @@ -464,7 +464,7 @@ PrimaryExpression: { /* Lookup foreign name in global static symbols. */ bound_minimal_symbol msymbol - = lookup_bound_minimal_symbol (copy.c_str ()); + = lookup_minimal_symbol (copy.c_str ()); if (msymbol.minsym != NULL) pstate->push_new (msymbol); else if (!have_full_symbols (current_program_space) diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c index cba460baab3..cc07933526c 100644 --- a/gdb/fbsd-tdep.c +++ b/gdb/fbsd-tdep.c @@ -2059,7 +2059,7 @@ fbsd_get_thread_local_address (struct gdbarch *gdbarch, CORE_ADDR dtv_addr, CORE_ADDR fbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { - bound_minimal_symbol msym = lookup_bound_minimal_symbol ("_rtld_bind"); + bound_minimal_symbol msym = lookup_minimal_symbol ("_rtld_bind"); if (msym.minsym != nullptr && msym.value_address () == pc) return frame_unwind_caller_pc (get_current_frame ()); diff --git a/gdb/glibc-tdep.c b/gdb/glibc-tdep.c index 493645d9a3b..8f27133faea 100644 --- a/gdb/glibc-tdep.c +++ b/gdb/glibc-tdep.c @@ -53,7 +53,7 @@ glibc_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) debugging programs that use shared libraries. */ bound_minimal_symbol resolver - = lookup_bound_minimal_symbol ("_dl_runtime_resolve"); + = lookup_minimal_symbol ("_dl_runtime_resolve"); if (resolver.minsym) { diff --git a/gdb/go-exp.y b/gdb/go-exp.y index 345b2315d3a..ce2b7e61967 100644 --- a/gdb/go-exp.y +++ b/gdb/go-exp.y @@ -572,7 +572,7 @@ variable: name_not_typename std::string arg = copy_name ($1.stoken); bound_minimal_symbol msymbol = - lookup_bound_minimal_symbol (arg.c_str ()); + lookup_minimal_symbol (arg.c_str ()); if (msymbol.minsym != NULL) pstate->push_new (msymbol); diff --git a/gdb/minsyms.c b/gdb/minsyms.c index bc6ab516a61..31e8e7d2a19 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -473,14 +473,6 @@ lookup_minimal_symbol (const char *name, objfile *objf, const char *sfile) return {}; } -/* See minsyms.h. */ - -bound_minimal_symbol -lookup_bound_minimal_symbol (const char *name) -{ - return lookup_minimal_symbol (name); -} - /* See gdbsupport/symbol.h. */ int diff --git a/gdb/minsyms.h b/gdb/minsyms.h index f8d4117f7b9..b05ca2bda74 100644 --- a/gdb/minsyms.h +++ b/gdb/minsyms.h @@ -209,11 +209,6 @@ 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. */ - -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 bound diff --git a/gdb/mips-fbsd-tdep.c b/gdb/mips-fbsd-tdep.c index 717c9c5dae4..22881e8a9c1 100644 --- a/gdb/mips-fbsd-tdep.c +++ b/gdb/mips-fbsd-tdep.c @@ -468,7 +468,7 @@ static const struct tramp_frame mips64_fbsd_sigframe = static CORE_ADDR mips_fbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { - bound_minimal_symbol msym = lookup_bound_minimal_symbol ("_mips_rtld_bind"); + bound_minimal_symbol msym = lookup_minimal_symbol ("_mips_rtld_bind"); if (msym.minsym != nullptr && msym.value_address () == pc) return frame_unwind_caller_pc (get_current_frame ()); diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 1054297c70f..3d50d1019c8 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -1241,11 +1241,10 @@ find_objc_msgsend (void) for (i = 0; i < nmethcalls; i++) { /* Try both with and without underscore. */ - bound_minimal_symbol func - = lookup_bound_minimal_symbol (methcalls[i].name); + bound_minimal_symbol func = lookup_minimal_symbol (methcalls[i].name); if ((func.minsym == NULL) && (methcalls[i].name[0] == '_')) { - func = lookup_bound_minimal_symbol (methcalls[i].name + 1); + func = lookup_minimal_symbol (methcalls[i].name + 1); } if (func.minsym == NULL) { diff --git a/gdb/p-exp.y b/gdb/p-exp.y index 77f853b5e6b..7476176c957 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -720,7 +720,7 @@ variable: name_not_typename std::string arg = copy_name ($1.stoken); bound_minimal_symbol msymbol - = lookup_bound_minimal_symbol (arg.c_str ()); + = lookup_minimal_symbol (arg.c_str ()); if (msymbol.minsym != NULL) pstate->push_new (msymbol); diff --git a/gdb/parse.c b/gdb/parse.c index 1b602a74f5c..d5bbc4dec58 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -145,7 +145,7 @@ parser_state::push_symbol (const char *name, block_symbol sym) } else { - bound_minimal_symbol msymbol = lookup_bound_minimal_symbol (name); + bound_minimal_symbol msymbol = lookup_minimal_symbol (name); if (msymbol.minsym != NULL) push_new (msymbol); else if (!have_full_symbols (current_program_space) @@ -231,7 +231,7 @@ parser_state::push_dollar (struct stoken str) push_new (sym); return; } - bound_minimal_symbol msym = lookup_bound_minimal_symbol (copy.c_str ()); + bound_minimal_symbol msym = lookup_minimal_symbol (copy.c_str ()); if (msym.minsym) { push_new (msym); diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 8e025839cf4..d2d5497913c 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1600,7 +1600,7 @@ info_address_command (const char *exp, int from_tty) return; } - bound_minimal_symbol msymbol = lookup_bound_minimal_symbol (exp); + bound_minimal_symbol msymbol = lookup_minimal_symbol (exp); if (msymbol.minsym != NULL) { @@ -1753,7 +1753,7 @@ info_address_command (const char *exp, int from_tty) case LOC_UNRESOLVED: { bound_minimal_symbol msym - = lookup_bound_minimal_symbol (sym->linkage_name ()); + = lookup_minimal_symbol (sym->linkage_name ()); if (msym.minsym == NULL) gdb_printf ("unresolved"); else diff --git a/gdb/symfile.c b/gdb/symfile.c index 76433293fa3..c9f5e9dfab1 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -3442,8 +3442,7 @@ simple_read_overlay_table (void) return 0; } - bound_minimal_symbol ovly_table_msym - = lookup_bound_minimal_symbol ("_ovly_table"); + bound_minimal_symbol ovly_table_msym = lookup_minimal_symbol ("_ovly_table"); if (! ovly_table_msym.minsym) { error (_("Error reading inferior's overlay table: couldn't find " diff --git a/gdb/valops.c b/gdb/valops.c index af2b76055bc..cca610ae28d 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -129,7 +129,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) } else { - bound_minimal_symbol msymbol = lookup_bound_minimal_symbol (name); + bound_minimal_symbol msymbol = lookup_minimal_symbol (name); if (msymbol.minsym != NULL) { diff --git a/gdb/value.c b/gdb/value.c index 45038fb69d0..42a7af4f9ff 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -3176,7 +3176,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f, nullptr).symbol; if (sym == nullptr) { - msym = lookup_bound_minimal_symbol (physname); + msym = lookup_minimal_symbol (physname); if (msym.minsym == NULL) return NULL; } diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c index f04724f18ba..6eea6346199 100644 --- a/gdb/z80-tdep.c +++ b/gdb/z80-tdep.c @@ -908,7 +908,7 @@ z80_read_overlay_region_table () } bound_minimal_symbol ovly_region_table_msym - = lookup_bound_minimal_symbol ("_ovly_region_table"); + = lookup_minimal_symbol ("_ovly_region_table"); if (! ovly_region_table_msym.minsym) { error (_("Error reading inferior's overlay table: couldn't find "