]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: remove lookup_bound_minimal_symbol
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 17 Jul 2024 03:52:01 +0000 (23:52 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 12 Aug 2024 14:31:09 +0000 (10:31 -0400)
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 <keiths@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
20 files changed:
gdb/ada-tasks.c
gdb/c-exp.y
gdb/coff-pe-read.c
gdb/compile/compile-c-symbols.c
gdb/compile/compile-cplus-symbols.c
gdb/d-exp.y
gdb/fbsd-tdep.c
gdb/glibc-tdep.c
gdb/go-exp.y
gdb/minsyms.c
gdb/minsyms.h
gdb/mips-fbsd-tdep.c
gdb/objc-lang.c
gdb/p-exp.y
gdb/parse.c
gdb/printcmd.c
gdb/symfile.c
gdb/valops.c
gdb/value.c
gdb/z80-tdep.c

index 72a1399369eaea2725eb8f0145ee1a335a8313d8..43a63f86355934ee56a625d7e642fa379ae37c68 100644 (file)
@@ -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)
     {
index 9240552db939ab31ea300171999731d76acd0dca..a06a00007bce6bcb4e774ee2289671c80c9e6590 100644 (file)
@@ -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)
index 9d087212b8c1a1ede76c6e1ba59ec3139a5aa6ce..9cfa1a372976cd8777b8475dac8c293717358378 100644 (file)
@@ -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)
index 1dffa6be6ad1bcfc34cad84e4ffde061ba0d9c64..e2af722c8170b2e1123ff5c9a19071d0026d8e7e 100644 (file)
@@ -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)
index 45b965a30fa3a80ab41ffd9edf2ab146036aa034..7e251a6ef0a2c893a1731db7e66bcc76236ce8b4 100644 (file)
@@ -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)
index f4de994ae4d602abd038b8e6af8795163e8248a7..9fc63afaa1c15987e538f01407fb9ada16de15ca 100644 (file)
@@ -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<var_msym_value_operation> (msymbol);
                      else if (!have_full_symbols (current_program_space)
index cba460baab388248d4afede1df723cb5bf713584..cc07933526c67605792b4877928124b60555d1f8 100644 (file)
@@ -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 ());
 
index 493645d9a3b9413a4d5f996d843be884d2e7756b..8f27133faea7ddef6e90d74fee5fb5a2e0081289 100644 (file)
@@ -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)
     {
index 345b2315d3af91db83c32edc427f89b1bbf1304b..ce2b7e619671552fede5b474f72d080e40275e8c 100644 (file)
@@ -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<var_msym_value_operation>
                                  (msymbol);
index bc6ab516a614d550b7ac300ac0ad076713dc91b0..31e8e7d2a19470c912713884f5e9472c3c920938 100644 (file)
@@ -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
index f8d4117f7b9dba80dfb0b21c313ec89903c19aca..b05ca2bda740d24ca0172abf462901f26144314c 100644 (file)
@@ -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
index 717c9c5dae476bc02568313bc93e03e413758b69..22881e8a9c104e5e9a4c6d2b1d542ceb625c2a7a 100644 (file)
@@ -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 ());
 
index 1054297c70f0c9a2d6eca81f117bcf68d856d66b..3d50d1019c826c38017f6ef0e8f0f7228468b7a5 100644 (file)
@@ -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)
        { 
index 77f853b5e6be92395f2f9bc0e9b4c17196531bed..7476176c9572c81921f8271d3e96b703f17863d4 100644 (file)
@@ -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<var_msym_value_operation>
                                  (msymbol);
index 1b602a74f5c4718fbd3dc9b9a409726c13900cd2..d5bbc4dec58a807586ebff81c7bd5d5be425a83b 100644 (file)
@@ -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<expr::var_msym_value_operation> (msymbol);
       else if (!have_full_symbols (current_program_space)
@@ -231,7 +231,7 @@ parser_state::push_dollar (struct stoken str)
       push_new<expr::var_value_operation> (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<expr::var_msym_value_operation> (msym);
index 8e025839cf4c04132a40c98fbad5686854f99224..d2d5497913c6fd4d6cb0dffbd06d89e821b30fda 100644 (file)
@@ -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
index 76433293fa39a7e3bdab33e3d817acd165143634..c9f5e9dfab1fac09196f46f4a6ffb6a016b8bbd2 100644 (file)
@@ -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 "
index af2b76055bc256de4f778fcde53968fee558c618..cca610ae28d0b607f73c81ffb1f242cdf0e434cd 100644 (file)
@@ -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)
        {
index 45038fb69d0fcd766738a1b0e242c6cba7f4d920..42a7af4f9ff60b32f09203b8078ce94f81fed4fa 100644 (file)
@@ -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;
     }
index f04724f18badecd6e8aad0a39ffa8d7954f2ef35..6eea6346199fc5c4994af5929adb6eaed3a35ca7 100644 (file)
@@ -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 "