]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: add program_space parameter to lookup_minimal_symbol
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 17 Jul 2024 03:52:02 +0000 (23:52 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 12 Aug 2024 14:31:09 +0000 (10:31 -0400)
>From what I can see, lookup_minimal_symbol doesn't have any dependencies
on the global current state other than the single reference to
current_program_space.  Add a program_space parameter and make that
current_program_space reference bubble up one level.

Change-Id: I759415e2f9c74c9627a2fe05bd44eb4147eee6fe
Reviewed-by: Keith Seitz <keiths@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
66 files changed:
gdb/ada-lang.c
gdb/ada-tasks.c
gdb/aix-thread.c
gdb/arc-linux-tdep.c
gdb/arm-tdep.c
gdb/auxv.c
gdb/avr-tdep.c
gdb/ax-gdb.c
gdb/breakpoint.c
gdb/bsd-uthread.c
gdb/c-exp.y
gdb/coff-pe-read.c
gdb/coffread.c
gdb/compile/compile-c-symbols.c
gdb/compile/compile-cplus-symbols.c
gdb/compile/compile-object-load.c
gdb/ctfread.c
gdb/d-exp.y
gdb/d-lang.c
gdb/dbxread.c
gdb/dwarf2/loc.c
gdb/elfread.c
gdb/eval.c
gdb/fbsd-tdep.c
gdb/findvar.c
gdb/frame.c
gdb/frv-tdep.c
gdb/ft32-tdep.c
gdb/gcore.c
gdb/glibc-tdep.c
gdb/gnu-v3-abi.c
gdb/go-exp.y
gdb/go-lang.c
gdb/hppa-tdep.c
gdb/linux-fork.c
gdb/linux-thread-db.c
gdb/m32c-tdep.c
gdb/m32r-tdep.c
gdb/m68hc11-tdep.c
gdb/machoread.c
gdb/minsyms.c
gdb/minsyms.h
gdb/mips-fbsd-tdep.c
gdb/mips-linux-tdep.c
gdb/netbsd-tdep.c
gdb/objc-lang.c
gdb/obsd-tdep.c
gdb/p-exp.y
gdb/p-lang.c
gdb/parse.c
gdb/ppc-sysv-tdep.c
gdb/printcmd.c
gdb/proc-service.c
gdb/ravenscar-thread.c
gdb/remote.c
gdb/sol-thread.c
gdb/sol2-tdep.c
gdb/solib-dsbt.c
gdb/solib-frv.c
gdb/solib-svr4.c
gdb/symfile.c
gdb/tracepoint.c
gdb/tui/tui-disasm.c
gdb/valops.c
gdb/value.c
gdb/z80-tdep.c

index 972c756cab00bb9935d3512793480f6671aa80f2..f293af695089a25b0c04d3df3eabef4d52a8b9a4 100644 (file)
@@ -806,7 +806,8 @@ 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);
+    = lookup_minimal_symbol (current_program_space,
+                            ADA_MAIN_PROGRAM_SYMBOL_NAME);
 
   if (msym.minsym != NULL)
     {
@@ -11696,7 +11697,8 @@ 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);
+       = lookup_minimal_symbol (current_program_space,
+                                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 +11718,8 @@ 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);
+       = lookup_minimal_symbol (current_program_space,
+                                einfo->catch_handlers_sym);
 
       if (msym.minsym && msym.minsym->type () != mst_solib_trampoline)
        error (_("Your Ada runtime appears to be missing some debugging "
index 43a63f86355934ee56a625d7e642fa379ae37c68..01ee2fb5686c8c19d82915a29861abb3091bebbf 100644 (file)
@@ -600,7 +600,7 @@ ada_get_tcb_types_info (void)
 
   /* Check for the CPU offset.  */
   bound_minimal_symbol first_id_sym
-    = lookup_minimal_symbol ("__gnat_gdb_cpu_first_id");
+    = lookup_minimal_symbol (current_program_space, "__gnat_gdb_cpu_first_id");
   unsigned int first_id = 0;
   if (first_id_sym.minsym != nullptr)
     {
@@ -920,7 +920,8 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
 
   /* Try array.  */
 
-  bound_minimal_symbol msym = lookup_minimal_symbol (KNOWN_TASKS_NAME);
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, KNOWN_TASKS_NAME);
   if (msym.minsym != NULL)
     {
       data->known_tasks_kind = ADA_TASKS_ARRAY;
@@ -967,7 +968,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
 
   /* Try list.  */
 
-  msym = lookup_minimal_symbol (KNOWN_TASKS_LIST);
+  msym = lookup_minimal_symbol (current_program_space, KNOWN_TASKS_LIST);
   if (msym.minsym != NULL)
     {
       data->known_tasks_kind = ADA_TASKS_LIST;
index 847c9006616f7f6e789d037cc077a20836d23a28..9e6952b974f4a8e4fe631a07c7a5b08fdf7372b2 100644 (file)
@@ -395,7 +395,8 @@ 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);
+         bound_minimal_symbol ms
+           = lookup_minimal_symbol (current_program_space, name);
          if (ms.minsym == NULL)
            {
              if (debug_aix_thread)
@@ -978,7 +979,8 @@ pd_enable (inferior *inf)
     return;
 
   /* Set a breakpoint on the returned stub function.  */
-  bound_minimal_symbol ms = lookup_minimal_symbol (stub_name);
+  bound_minimal_symbol ms
+    = lookup_minimal_symbol (current_program_space, stub_name);
   if (ms.minsym == NULL)
     return;
   data->pd_brk_addr = ms.value_address ();
index d71c5bf0185d20b5fc9b7329c700b08f982cff86..01c591fd4ff09ea04f45b906196be01b22cf549a 100644 (file)
@@ -506,7 +506,8 @@ 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");
+  bound_minimal_symbol resolver
+    = lookup_minimal_symbol (current_program_space, "_dl_linux_resolver");
 
   if (arc_debug)
     {
index f3db289250595caa8d10cef4277a540871ff885a..d1269088d1299d53d125f763b623ca74e78dee9e 100644 (file)
@@ -9388,7 +9388,8 @@ 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, objfile);
+  bound_minimal_symbol minsym
+    = lookup_minimal_symbol (current_program_space, target_name, objfile);
   if (minsym.minsym != nullptr)
     return minsym.value_address ();
 
@@ -9477,7 +9478,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, objfile);
+       = lookup_minimal_symbol (current_program_space, target_name, objfile);
       if (minsym.minsym != NULL)
        return minsym.value_address ();
       else
index 8d259696ea3e3ccf384e9b4b794d4c57f822c601..8bcd347632bfb2578fdc221e98ecae10d0339cc2 100644 (file)
@@ -90,7 +90,8 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
   LONGEST retval;
   size_t block;
 
-  bound_minimal_symbol msym = lookup_minimal_symbol ("_dl_auxv");
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, "_dl_auxv");
   if (msym.minsym == NULL)
     return TARGET_XFER_E_IO;
 
index dc1eb61be1c56a2900fca355cd8d41ab2339a64d..9c97d3cf1c7049cfcad588bf084f87b28d56f499 100644 (file)
@@ -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__");
+       = lookup_minimal_symbol (current_program_space, "__prologue_saves__");
       if (!msymbol.minsym)
        break;
 
index db4dcc2e1d12cce07067f45ab39c4fb9741b1225..3d619012b4fe122fa9a577c64d8ca5df470466f1 100644 (file)
@@ -599,7 +599,8 @@ 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 ());
+         = lookup_minimal_symbol (current_program_space,
+                                  var->linkage_name ());
        if (!msym.minsym)
          error (_("Couldn't resolve symbol `%s'."), var->print_name ());
 
index 71da72497d2e8171f7016cd34f8e983d1e3b85e9..dd015b8ce975dcb9fc7eb6862bb4cd5f7368b4ea 100644 (file)
@@ -3752,7 +3752,8 @@ create_std_terminate_master_breakpoint (void)
          if (bp_objfile_data->terminate_msym.minsym == NULL)
            {
              bound_minimal_symbol m
-               = lookup_minimal_symbol (func_name, objfile);
+               = lookup_minimal_symbol (current_program_space, func_name,
+                                        objfile);
              if (m.minsym == NULL || (m.minsym->type () != mst_text
                                       && m.minsym->type () != mst_file_text))
                {
index d5beba2e8114679429fc58a8e8f2ed21fea638aa..eb1ed421abc3338f761181990f9d3a8028620333 100644 (file)
@@ -157,7 +157,8 @@ 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, objfile);
+  bound_minimal_symbol sym
+    = lookup_minimal_symbol (current_program_space, name, objfile);
   if (sym.minsym)
     return sym.value_address ();
 
index a06a00007bce6bcb4e774ee2289671c80c9e6590..ca411dc0f5b0bacb6830bed66a09d5c2a2816313 100644 (file)
@@ -1210,7 +1210,7 @@ variable: name_not_typename
                              std::string arg = copy_name ($1.stoken);
 
                              bound_minimal_symbol msymbol
-                               = lookup_minimal_symbol (arg.c_str ());
+                               = lookup_minimal_symbol (current_program_space, arg.c_str ());
                              if (msymbol.minsym == NULL)
                                {
                                  if (!have_full_symbols (current_program_space)
@@ -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 ()).minsym == nullptr)
+      && lookup_minimal_symbol (current_program_space, copy.c_str ()).minsym == nullptr)
     return UNKNOWN_CPP_NAME;
 
   return NAME;
index 9cfa1a372976cd8777b8475dac8c293717358378..ed5e533a36270f64da0f97a668d4b604a3b7b859 100644 (file)
@@ -183,14 +183,16 @@ add_pe_forwarded_sym (minimal_symbol_reader &reader,
                                                      forward_func_name);
 
   bound_minimal_symbol msymbol
-    = lookup_minimal_symbol (forward_qualified_name.c_str ());
+    = lookup_minimal_symbol (current_program_space,
+                            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_minimal_symbol (forward_qualified_name.c_str ());
+      msymbol = lookup_minimal_symbol (current_program_space,
+                                      forward_qualified_name.c_str ());
     }
 
   if (!msymbol.minsym)
index be1e21e8364e375920b3b299e14d5480d1bcbec9..3e67ebdef0772b43afd9c45115536b8e3d1c33bd 100644 (file)
@@ -579,7 +579,8 @@ coff_read_minsyms (file_ptr symtab_offset, unsigned int nsyms,
                    name1 += 1;
 
                  bound_minimal_symbol found
-                   = lookup_minimal_symbol (name1, objfile);
+                   = lookup_minimal_symbol (current_program_space, name1,
+                                            objfile);
 
                  /* If found, there are symbols named "_imp_foo" and "foo"
                     respectively in OBJFILE.  Set the type of symbol "foo"
index e2af722c8170b2e1123ff5c9a19071d0026d8e7e..7a38d3a6d59379eb573102d1b4d99b6fe90d7724 100644 (file)
@@ -355,7 +355,8 @@ gcc_convert_symbol (void *datum,
        }
       else if (request == GCC_C_ORACLE_SYMBOL)
        {
-         bound_minimal_symbol bmsym = lookup_minimal_symbol (identifier);
+         bound_minimal_symbol bmsym
+           = lookup_minimal_symbol (current_program_space, identifier);
          if (bmsym.minsym != NULL)
            {
              convert_symbol_bmsym (context, bmsym);
@@ -410,7 +411,8 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
        }
       else
        {
-         bound_minimal_symbol msym = lookup_minimal_symbol (identifier);
+         bound_minimal_symbol msym
+           = lookup_minimal_symbol (current_program_space, identifier);
          if (msym.minsym != NULL)
            {
              if (compile_debug)
index 7e251a6ef0a2c893a1731db7e66bcc76236ce8b4..6c482e74be60c9e1d30fcf2a0d482a17a68aa64a 100644 (file)
@@ -453,7 +453,8 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
        }
       else
        {
-         bound_minimal_symbol msym = lookup_minimal_symbol (identifier);
+         bound_minimal_symbol msym
+           = lookup_minimal_symbol (current_program_space, identifier);
          if (msym.minsym != nullptr)
            {
              if (compile_debug)
index cb690863107a71f9b6732d9103b38af39a5be03b..df48b1c54f5b393fbce9682f4124112a28706e85 100644 (file)
@@ -764,7 +764,8 @@ compile_object_load (const compile_file_names &file_names,
          continue;
        }
 
-      bound_minimal_symbol bmsym = lookup_minimal_symbol (sym->name);
+      bound_minimal_symbol bmsym
+       = lookup_minimal_symbol (current_program_space, sym->name);
       switch (bmsym.minsym == NULL
              ? mst_unknown : bmsym.minsym->type ())
        {
index eb7cf3110e0ddd3740a2a9971c9f03fde028a45d..9eb9537ef41c989b6fe9092b0e77d8da4f6b0d1b 100644 (file)
@@ -323,7 +323,8 @@ 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, of);
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, name, of);
   if (msym.minsym != NULL)
     {
       sym->set_value_address (msym.value_address ());
index 9fc63afaa1c15987e538f01407fb9ada16de15ca..df89cb63a35def07716ab71d23361bda65a258e6 100644 (file)
@@ -464,7 +464,7 @@ PrimaryExpression:
                    {
                      /* Lookup foreign name in global static symbols.  */
                      bound_minimal_symbol msymbol
-                       = lookup_minimal_symbol (copy.c_str ());
+                       = lookup_minimal_symbol (current_program_space, copy.c_str ());
                      if (msymbol.minsym != NULL)
                        pstate->push_new<var_msym_value_operation> (msymbol);
                      else if (!have_full_symbols (current_program_space)
index 11c5c03a3cdfbb5ce4957e20cfcaf348f14dd8da..32d9cc86eef0563056261abc0db480f0019dd62f 100644 (file)
@@ -38,7 +38,8 @@ static const char D_MAIN[] = "D main";
 const char *
 d_main_name (void)
 {
-  bound_minimal_symbol msym = lookup_minimal_symbol (D_MAIN);
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, D_MAIN);
   if (msym.minsym != NULL)
     return D_MAIN;
 
index 4b2a7d229ff110ea3a6b71dd64fb66d084b01057..31eb51faa73e8d048bf295c40f2fc40ea9bb264d 100644 (file)
@@ -907,7 +907,8 @@ find_stab_function (const char *namestring, const char *filename,
   strncpy (p, namestring, n);
   p[n] = 0;
 
-  bound_minimal_symbol msym = lookup_minimal_symbol (p, objfile, filename);
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, p, objfile, filename);
   if (msym.minsym == NULL)
     {
       /* Sun Fortran appends an underscore to the minimal symbol name,
@@ -915,21 +916,22 @@ find_stab_function (const char *namestring, const char *filename,
         was not found.  */
       p[n] = '_';
       p[n + 1] = 0;
-      msym = lookup_minimal_symbol (p, objfile, filename);
+      msym
+       = lookup_minimal_symbol (current_program_space, p, objfile, filename);
     }
 
   if (msym.minsym == NULL && filename != NULL)
     {
       /* Try again without the filename.  */
       p[n] = 0;
-      msym = lookup_minimal_symbol (p, objfile);
+      msym = lookup_minimal_symbol (current_program_space, 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, objfile);
+      msym = lookup_minimal_symbol (current_program_space, p, objfile);
     }
 
   return msym;
@@ -2044,7 +2046,8 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
       p[n] = 0;
 
       bound_minimal_symbol minsym
-       = lookup_minimal_symbol (p, objfile, pst->filename);
+       = lookup_minimal_symbol (current_program_space, p, objfile,
+                                pst->filename);
       if (minsym.minsym == NULL)
        {
          /* Sun Fortran appends an underscore to the minimal symbol name,
@@ -2052,7 +2055,8 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
             was not found.  */
          p[n] = '_';
          p[n + 1] = 0;
-         minsym = lookup_minimal_symbol (p, objfile, pst->filename);
+         minsym = lookup_minimal_symbol (current_program_space, p, objfile,
+                                         pst->filename);
        }
 
       if (minsym.minsym)
index 06e57be891b095c050bae54e95004afe082e8152..80c86bb850f7b8f6899cb56ee86aa69bef19903e 100644 (file)
@@ -710,7 +710,8 @@ 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);
+       bound_minimal_symbol msym
+         = lookup_minimal_symbol (current_program_space, physname);
        if (msym.minsym == NULL)
          {
            msym = lookup_minimal_symbol_by_pc (call_site->pc () - 1);
index 68b45efb2935025b9c3c75f9f2191f14e018738e..c71a142396058861b5b1b4fdad21f480b0fa2789 100644 (file)
@@ -844,7 +844,8 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p)
         gdb_byte *buf = (gdb_byte *) alloca (ptr_size);
 
         bound_minimal_symbol msym
-          = lookup_minimal_symbol (name_got_plt, objfile);
+          = lookup_minimal_symbol (current_program_space, name_got_plt,
+                                   objfile);
         if (msym.minsym == NULL)
           return 0;
         if (msym.minsym->type () != mst_slot_got_plt)
index bf78509c85088fcbcb5a3747af54fc0dde3ad2e2..bbf4375f1d3caf2b91731c6d5cd9bc22748b8c7e 100644 (file)
@@ -1954,7 +1954,8 @@ 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").minsym != nullptr)
+  if (lookup_minimal_symbol (current_program_space, "objc_msg_lookup").minsym
+      != nullptr)
     gnu_runtime = 1;
 
   /* Find the method dispatch (Apple runtime) or method lookup
index cc07933526c67605792b4877928124b60555d1f8..ac51f101d2711b369f79e9606426b2eca0d36cab 100644 (file)
@@ -1943,7 +1943,8 @@ 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);
+  bound_minimal_symbol ms
+    = lookup_minimal_symbol (current_program_space, name);
   if (ms.minsym == NULL)
     error (_("Unable to resolve symbol '%s'"), name);
 
@@ -2059,7 +2060,8 @@ 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_minimal_symbol ("_rtld_bind");
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, "_rtld_bind");
   if (msym.minsym != nullptr && msym.value_address () == pc)
     return frame_unwind_caller_pc (get_current_frame ());
 
index c67315fb68494324328331143a1695c2dd4a9441..f7760aa61ca95b6a94c659d05c010eb48cecf558 100644 (file)
@@ -449,7 +449,8 @@ language_defn::read_var_value (struct symbol *var,
          (var->arch (),
           [var, &bmsym] (objfile *objfile)
             {
-               bmsym = lookup_minimal_symbol (var->linkage_name (), objfile);
+               bmsym = lookup_minimal_symbol (current_program_space,
+                                              var->linkage_name (), objfile);
 
                /* Stop if a match is found.  */
                return bmsym.minsym != nullptr;
index 8c30979bb2f16afb13b402fd51850fb8f2979b58..4d092d0e8c8756e87142f6b7d7447cd57f47f1c5 100644 (file)
@@ -2584,7 +2584,8 @@ 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, current_program_space->symfile_object_file);
+    = lookup_minimal_symbol (current_program_space, name,
+                            current_program_space->symfile_object_file);
 
   if (msymbol.minsym != nullptr)
     sym_addr = msymbol.value_address ();
index 80cc546cea78fd5018da4e98854d1d6e6a492b7b..6ae3f0d0f55eaa55c1b7685a7582b08595b39d07 100644 (file)
@@ -1379,7 +1379,8 @@ 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");
+  bound_minimal_symbol msym_stack
+    = lookup_minimal_symbol (current_program_space, "_stack");
   if (msym_stack.minsym && info->base == msym_stack.value_address ())
     return;
 
index 00dd763538901b9d2b2db98781f4821afc2a4ed8..15a585a356e2cc7df7830c987052c8875cef8c1a 100644 (file)
@@ -195,7 +195,8 @@ 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);
+      bound_minimal_symbol msymbol
+       = lookup_minimal_symbol (current_program_space, prolog_symbol);
       if (msymbol.minsym)
        prologs[regnum] = msymbol.value_address ();
       else
index 0f04679a6bbc1800ef308c21e0586fa005c98b17..969a8543ba29da69e9f0128f62939d6250108c90 100644 (file)
@@ -269,13 +269,14 @@ call_target_sbrk (int sbrk_arg)
   struct value *sbrk_fn, *ret;
   bfd_vma tmp;
 
-  if (lookup_minimal_symbol ("sbrk").minsym != nullptr)
+  if (lookup_minimal_symbol (current_program_space, "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").minsym != nullptr)
+  else if (lookup_minimal_symbol (current_program_space, "_sbrk").minsym
+          != nullptr)
     {
       sbrk_fn = find_function_in_inferior ("_sbrk", &sbrk_objf);
       if (sbrk_fn == NULL)
index 8f27133faea7ddef6e90d74fee5fb5a2e0081289..e3bf00c6a89fe4cf5b040d55311944608a180aff 100644 (file)
@@ -53,17 +53,19 @@ glibc_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
      debugging programs that use shared libraries.  */
 
   bound_minimal_symbol resolver
-    = lookup_minimal_symbol ("_dl_runtime_resolve");
+    = lookup_minimal_symbol (current_program_space, "_dl_runtime_resolve");
 
   if (resolver.minsym)
     {
       /* The dynamic linker began using this name in early 2005.  */
       bound_minimal_symbol fixup
-       = lookup_minimal_symbol ("_dl_fixup", resolver.objfile);
+       = lookup_minimal_symbol (current_program_space, "_dl_fixup",
+                                resolver.objfile);
 
       /* This is the name used in older versions.  */
       if (! fixup.minsym)
-       fixup = lookup_minimal_symbol ("fixup", resolver.objfile);
+       fixup = lookup_minimal_symbol (current_program_space, "fixup",
+                                      resolver.objfile);
 
       if (fixup.minsym && fixup.value_address () == pc)
        return frame_unwind_caller_pc (get_current_frame ());
index 70cdde3d275212c586e762c0ec0caa53c7f0c752..aefbee5427030a7d7576fc0058dfad51d2952296 100644 (file)
@@ -1160,7 +1160,8 @@ 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 ());
+      bound_minimal_symbol minsym
+       = lookup_minimal_symbol (current_program_space, sym_name.c_str ());
 
       if (minsym.minsym == NULL)
        error (_("could not find typeinfo symbol for '%s'"), name);
@@ -1249,7 +1250,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, section->objfile);
+    = lookup_minimal_symbol (current_program_space, fn_name, section->objfile);
   if (fn_sym.minsym == NULL)
     return 0;
 
index ce2b7e619671552fede5b474f72d080e40275e8c..8fd673750ea8e06ef258ccae87379e4fcee9be03 100644 (file)
@@ -572,7 +572,7 @@ variable:   name_not_typename
                              std::string arg = copy_name ($1.stoken);
 
                              bound_minimal_symbol msymbol =
-                               lookup_minimal_symbol (arg.c_str ());
+                               lookup_minimal_symbol (current_program_space, arg.c_str ());
                              if (msymbol.minsym != NULL)
                                pstate->push_new<var_msym_value_operation>
                                  (msymbol);
index cf1f5a907a62e1671fde228e4dc2a1225c21e066..18d3fc1a008e6454a4320494c5f50dcf1d96a13e 100644 (file)
@@ -54,7 +54,8 @@ static const char GO_MAIN_MAIN[] = "main.main";
 const char *
 go_main_name (void)
 {
-  bound_minimal_symbol msym = lookup_minimal_symbol (GO_MAIN_MAIN);
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, GO_MAIN_MAIN);
   if (msym.minsym != NULL)
     return GO_MAIN_MAIN;
 
index 0ce754a6ed66ace3a9b0ec418800a43a2b88ff73..ad93c2b204879760e6e216855832960564317996 100644 (file)
@@ -194,7 +194,8 @@ hppa_extract_17 (unsigned word)
 CORE_ADDR 
 hppa_symbol_address(const char *sym)
 {
-  bound_minimal_symbol minsym = lookup_minimal_symbol (sym);
+  bound_minimal_symbol minsym
+    = lookup_minimal_symbol (current_program_space, sym);
   if (minsym.minsym)
     return minsym.value_address ();
   else
index d36511b70fe5569cd2c72f3f987a6d182129d6ff..c457a90556d7e1e6d5b719a74760bd4276497e83 100644 (file)
@@ -484,9 +484,12 @@ 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").minsym != nullptr)
+  if (lookup_minimal_symbol (current_program_space, "waitpid").minsym
+      != nullptr)
     waitpid_fn = find_function_in_inferior ("waitpid", &waitpid_objf);
-  if (!waitpid_fn && lookup_minimal_symbol ("_waitpid").minsym != nullptr)
+  if (!waitpid_fn
+      && (lookup_minimal_symbol (current_program_space, "_waitpid").minsym
+         != nullptr))
     waitpid_fn = find_function_in_inferior ("_waitpid", &waitpid_objf);
   if (waitpid_fn != nullptr)
     {
@@ -700,10 +703,11 @@ checkpoint_command (const char *args, int from_tty)
   
   /* Make the inferior fork, record its (and gdb's) state.  */
 
-  if (lookup_minimal_symbol ("fork").minsym != nullptr)
+  if (lookup_minimal_symbol (current_program_space, "fork").minsym != nullptr)
     fork_fn = find_function_in_inferior ("fork", &fork_objf);
   if (!fork_fn)
-    if (lookup_minimal_symbol ("_fork").minsym != nullptr)
+    if (lookup_minimal_symbol (current_program_space, "_fork").minsym
+       != nullptr)
       fork_fn = find_function_in_inferior ("fork", &fork_objf);
   if (!fork_fn)
     error (_("checkpoint: can't find fork function in inferior."));
index 6abaa20c594eb17acbbe4ca6140dd800d83a983b..9d84187a9ad0897ced25c7639e92ebb2e1e96746 100644 (file)
@@ -470,7 +470,8 @@ 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);
+  bound_minimal_symbol version_msym
+    = lookup_minimal_symbol (current_program_space, ver_symbol);
   if (version_msym.minsym == NULL)
     return 0;
 
@@ -809,7 +810,8 @@ static bool
 libpthread_objfile_p (objfile *obj)
 {
   return (libpthread_name_p (objfile_name (obj))
-         && lookup_minimal_symbol ("pthread_create", obj).minsym != nullptr);
+         && lookup_minimal_symbol (current_program_space,
+                                   "pthread_create", obj).minsym != nullptr);
 }
 
 /* Attempt to initialize dlopen()ed libthread_db, described by INFO.
index 3531fbb899bacfa63301b2af8535036a75ec6747..28dfb2fb7c6b33ed205b4580ccfc747b8ad27128 100644 (file)
@@ -2212,7 +2212,8 @@ 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");
+         bound_minimal_symbol mem0
+           = lookup_minimal_symbol (current_program_space, "mem0");
 
          if (! mem0.minsym)
            error (_("The return value is stored in memory at 'mem0', "
@@ -2243,7 +2244,8 @@ 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");
+         bound_minimal_symbol mem0
+           = lookup_minimal_symbol (current_program_space, "mem0");
 
          if (! mem0.minsym)
            error (_("The return value is stored in memory at 'mem0', "
@@ -2434,7 +2436,8 @@ 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);
+      bound_minimal_symbol tramp_msym
+       = lookup_minimal_symbol (current_program_space, tramp_name);
 
       /* We've either got another copy of the name now, or don't need
         the name any more.  */
@@ -2518,7 +2521,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);
+               = lookup_minimal_symbol (current_program_space, func_name);
 
              /* If we do have such a symbol, return its value as the
                 function's true address.  */
index 4899c1556669ef32f540bf6abe12b157e5a29c4d..c6428f6db6f6ed76ebd6813bd532072fb2f00480 100644 (file)
@@ -806,7 +806,8 @@ 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");
+  bound_minimal_symbol msym_stack
+    = lookup_minimal_symbol (current_program_space, "_stack");
   if (msym_stack.minsym && info->base == msym_stack.value_address ())
     return;
 
index 8075dbb0508a49bb9d207396e095a1c3f8e6a4f3..12cd0efbbe73711536a4cc1cf31a4af8a66c615f 100644 (file)
@@ -210,7 +210,8 @@ 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);
+  bound_minimal_symbol msymbol
+    = lookup_minimal_symbol (current_program_space, name);
   if (msymbol.minsym)
     {
       reg->addr = msymbol.value_address ();
index 5840b663bbeb321406f3aa8acaed64b86b759f1e..ef6cf6606299c1f77538169f121688ee9f151f15 100644 (file)
@@ -396,7 +396,8 @@ 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, main_objfile);
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, name, main_objfile);
   if (msym.minsym == NULL)
     {
       warning (_("can't find symbol '%s' in minsymtab"), name);
index 31e8e7d2a19470c912713884f5e9472c3c920938..ba9da1d81af5f6c30365ea6f28ab92521657500a 100644 (file)
@@ -359,7 +359,8 @@ 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, objfile *objf, const char *sfile)
+lookup_minimal_symbol (program_space *pspace, const char *name, objfile *objf,
+                      const char *sfile)
 {
   found_minimal_symbols found;
 
@@ -375,7 +376,7 @@ lookup_minimal_symbol (const char *name, objfile *objf, const char *sfile)
 
   lookup_name_info lookup_name (name, symbol_name_match_type::FULL);
 
-  for (objfile *objfile : current_program_space->objfiles ())
+  for (objfile *objfile : pspace->objfiles ())
     {
       if (found.external_symbol.minsym != NULL)
        break;
@@ -383,7 +384,8 @@ lookup_minimal_symbol (const char *name, objfile *objf, const char *sfile)
       if (objf == NULL || objf == objfile
          || objf == objfile->separate_debug_objfile_backlink)
        {
-         symbol_lookup_debug_printf ("lookup_minimal_symbol (%s, %s, %s)",
+         symbol_lookup_debug_printf ("lookup_minimal_symbol (%s, %s, %s, %s)",
+                                     host_address_to_string (pspace),
                                      name, sfile != NULL ? sfile : "NULL",
                                      objfile_debug_name (objfile));
 
@@ -479,7 +481,8 @@ int
 find_minimal_symbol_address (const char *name, CORE_ADDR *addr,
                             struct objfile *objfile)
 {
-  bound_minimal_symbol sym = lookup_minimal_symbol (name, objfile);
+  bound_minimal_symbol sym
+    = lookup_minimal_symbol (current_program_space, name, objfile);
   if (sym.minsym != NULL)
     *addr = sym.value_address ();
 
index b05ca2bda740d24ca0172abf462901f26144314c..0d9b9ad51ceeb0eb7b4967ec2e3ebf8540405502 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef MINSYMS_H
 #define MINSYMS_H
 
+struct program_space;
 struct type;
 
 /* Several lookup functions return both a minimal symbol and the
@@ -205,7 +206,8 @@ 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 *name,
+bound_minimal_symbol lookup_minimal_symbol (program_space *pspace,
+                                           const char *name,
                                            objfile *obj = nullptr,
                                            const char *sfile = nullptr);
 
index 22881e8a9c104e5e9a4c6d2b1d542ceb625c2a7a..773607861aa9d761a1d695159fd90a615188c9df 100644 (file)
@@ -468,7 +468,8 @@ 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_minimal_symbol ("_mips_rtld_bind");
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, "_mips_rtld_bind");
   if (msym.minsym != nullptr && msym.value_address () == pc)
     return frame_unwind_caller_pc (get_current_frame ());
 
index dd37d2ce7c751f7801df1adcf512a1063b96a037..b076d24ac629df14d69540a28c046859f2af16c0 100644 (file)
@@ -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");
+    = lookup_minimal_symbol (current_program_space, "__dl_runtime_resolve");
 
   if (resolver.minsym && resolver.value_address () == pc)
     return frame_unwind_caller_pc (get_current_frame ());
index 4d2c41294464e2eb426f5f6c410cfc1ed005bb4b..415a7432787ede7fe6d8b29205bf172a14132742 100644 (file)
@@ -348,7 +348,8 @@ 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");
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, "_rtld_bind_start");
   if (msym.minsym && msym.value_address () == pc)
     return frame_unwind_caller_pc (get_current_frame ());
   else
index 3d50d1019c826c38017f6ef0e8f0f7228468b7a5..cf789791c6d1bd08af3513c53da531c1b01abf55 100644 (file)
@@ -120,9 +120,11 @@ lookup_objc_class (struct gdbarch *gdbarch, const char *classname)
       return 0;
     }
 
-  if (lookup_minimal_symbol ("objc_lookUpClass").minsym != nullptr)
+  if (lookup_minimal_symbol (current_program_space,
+                            "objc_lookUpClass").minsym != nullptr)
     function = find_function_in_inferior("objc_lookUpClass", NULL);
-  else if (lookup_minimal_symbol ("objc_lookup_class").minsym != nullptr)
+  else if (lookup_minimal_symbol (current_program_space,
+                                 "objc_lookup_class").minsym != nullptr)
     function = find_function_in_inferior("objc_lookup_class", NULL);
   else
     {
@@ -149,9 +151,11 @@ lookup_child_selector (struct gdbarch *gdbarch, const char *selname)
       return 0;
     }
 
-  if (lookup_minimal_symbol ("sel_getUid").minsym != nullptr)
+  if (lookup_minimal_symbol (current_program_space, "sel_getUid").minsym
+      != nullptr)
     function = find_function_in_inferior("sel_getUid", NULL);
-  else if (lookup_minimal_symbol ("sel_get_any_uid").minsym != nullptr)
+  else if (lookup_minimal_symbol (current_program_space,
+                                 "sel_get_any_uid").minsym != nullptr)
     function = find_function_in_inferior("sel_get_any_uid", NULL);
   else
     {
@@ -180,17 +184,20 @@ 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").minsym != nullptr)
+  if (lookup_minimal_symbol (current_program_space,
+                            "_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").minsym != nullptr)
+  else if (lookup_minimal_symbol (current_program_space,
+                                 "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:]").minsym
+  else if (lookup_minimal_symbol (current_program_space,
+                                 "+[NSString stringWithCString:]").minsym
           != nullptr)
     {
       function
@@ -1138,7 +1145,8 @@ 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);
+         bound_minimal_symbol msym
+           = lookup_minimal_symbol (current_program_space, selector);
 
          if (msym.minsym != NULL) 
            symbol_names->push_back (msym.minsym->natural_name ());
@@ -1241,10 +1249,12 @@ find_objc_msgsend (void)
   for (i = 0; i < nmethcalls; i++)
     {
       /* Try both with and without underscore.  */
-      bound_minimal_symbol func = lookup_minimal_symbol (methcalls[i].name);
+      bound_minimal_symbol func
+       = lookup_minimal_symbol (current_program_space, methcalls[i].name);
       if ((func.minsym == NULL) && (methcalls[i].name[0] == '_'))
        {
-         func = lookup_minimal_symbol (methcalls[i].name + 1);
+         func = lookup_minimal_symbol (current_program_space,
+                                       methcalls[i].name + 1);
        }
       if (func.minsym == NULL)
        { 
index 755e612823e726cf65951964bdfef3778236ad46..00de5c0c0952a6d9f008b9039cc5d7c6f6e4c191 100644 (file)
@@ -27,7 +27,8 @@
 CORE_ADDR
 obsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
-  bound_minimal_symbol msym = lookup_minimal_symbol ("_dl_bind");
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, "_dl_bind");
   if (msym.minsym && msym.value_address () == pc)
     return frame_unwind_caller_pc (get_current_frame ());
   else
index 7476176c9572c81921f8271d3e96b703f17863d4..ad7cd58196f79405d59a778ffc55db01b7403bf2 100644 (file)
@@ -720,7 +720,7 @@ variable:   name_not_typename
                              std::string arg = copy_name ($1.stoken);
 
                              bound_minimal_symbol msymbol
-                               = lookup_minimal_symbol (arg.c_str ());
+                               = lookup_minimal_symbol (current_program_space, arg.c_str ());
                              if (msymbol.minsym != NULL)
                                pstate->push_new<var_msym_value_operation>
                                  (msymbol);
index 70f28c980d94b47dcf152e79edc91c9cd824bc15..4c5d4dd1eaf7377bab924df1d21bb7f4d7597d8e 100644 (file)
@@ -59,20 +59,23 @@ 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);
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, 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);
+  msym
+    = lookup_minimal_symbol (current_program_space, GPC_MAIN_PROGRAM_NAME_1);
   if (msym.minsym != NULL)
     {
       return GPC_MAIN_PROGRAM_NAME_1;
     }
 
-  msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_2);
+  msym
+    = lookup_minimal_symbol (current_program_space, GPC_MAIN_PROGRAM_NAME_2);
   if (msym.minsym != NULL)
     {
       return GPC_MAIN_PROGRAM_NAME_2;
index d5bbc4dec58a807586ebff81c7bd5d5be425a83b..03763de74e7c5da53ea91415f1b2e62182af7967 100644 (file)
@@ -145,7 +145,8 @@ parser_state::push_symbol (const char *name, block_symbol sym)
     }
   else
     {
-      bound_minimal_symbol msymbol = lookup_minimal_symbol (name);
+      bound_minimal_symbol msymbol
+       = lookup_minimal_symbol (current_program_space, name);
       if (msymbol.minsym != NULL)
        push_new<expr::var_msym_value_operation> (msymbol);
       else if (!have_full_symbols (current_program_space)
@@ -231,7 +232,8 @@ parser_state::push_dollar (struct stoken str)
       push_new<expr::var_value_operation> (sym);
       return;
     }
-  bound_minimal_symbol msym = lookup_minimal_symbol (copy.c_str ());
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, copy.c_str ());
   if (msym.minsym)
     {
       push_new<expr::var_msym_value_operation> (msym);
index cdba46c2a88aaff20618dc9cda2a8cc7cbfd3847..f317c94ef598a08cc428498e5b957a96ef170c8b 100644 (file)
@@ -1060,7 +1060,8 @@ 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,
+    = lookup_minimal_symbol (current_program_space,
+                            dot_fn.minsym->linkage_name () + 1,
                             dot_fn_section->objfile);
   if (fn.minsym == NULL)
     return 0;
index d2d5497913c6fd4d6cb0dffbd06d89e821b30fda..f1aaa644042e93a3435d7aaa4e8d26bfe9185f10 100644 (file)
@@ -1600,7 +1600,8 @@ info_address_command (const char *exp, int from_tty)
          return;
        }
 
-      bound_minimal_symbol msymbol = lookup_minimal_symbol (exp);
+      bound_minimal_symbol msymbol
+       = lookup_minimal_symbol (current_program_space, exp);
 
       if (msymbol.minsym != NULL)
        {
@@ -1753,7 +1754,8 @@ info_address_command (const char *exp, int from_tty)
     case LOC_UNRESOLVED:
       {
        bound_minimal_symbol msym
-         = lookup_minimal_symbol (sym->linkage_name ());
+         = lookup_minimal_symbol (current_program_space,
+                                  sym->linkage_name ());
        if (msym.minsym == NULL)
          gdb_printf ("unresolved");
        else
index bf57efd6c1faf4bdccf640a045abbe0f8db794e6..ce2d69a0ce781d54d1f5a6fe9c25fc135a9f69f2 100644 (file)
@@ -99,7 +99,8 @@ 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);
+  bound_minimal_symbol ms
+    = lookup_minimal_symbol (current_program_space, name);
   if (ms.minsym == NULL)
     return PS_NOSYM;
 
index 68c2978a92ed9f04246998b70d381c5ddb7f3460..47db72b2d6902265ea8d2a254b8080a41f33aa8a 100644 (file)
@@ -329,13 +329,14 @@ ravenscar_thread_target::add_active_thread ()
 static bound_minimal_symbol
 get_running_thread_msymbol ()
 {
-  bound_minimal_symbol msym = lookup_minimal_symbol (running_thread_name);
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, 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");
+    msym = lookup_minimal_symbol (current_program_space, "running_thread");
 
   return msym;
 }
@@ -347,11 +348,12 @@ static bool
 has_ravenscar_runtime ()
 {
   bound_minimal_symbol msym_ravenscar_runtime_initializer
-    = lookup_minimal_symbol (ravenscar_runtime_initializer);
+    = lookup_minimal_symbol (current_program_space,
+                            ravenscar_runtime_initializer);
   bound_minimal_symbol msym_known_tasks
-    = lookup_minimal_symbol (known_tasks_name);
+    = lookup_minimal_symbol (current_program_space, known_tasks_name);
   bound_minimal_symbol msym_first_task
-    = lookup_minimal_symbol (first_task_name);
+    = lookup_minimal_symbol (current_program_space, first_task_name);
   bound_minimal_symbol msym_running_thread = get_running_thread_msymbol ();
 
   return (msym_ravenscar_runtime_initializer.minsym
@@ -639,7 +641,8 @@ ravenscar_thread_target::get_fpu_state (struct regcache *regcache,
     return NOTHING_SPECIAL;
 
   bound_minimal_symbol fpu_context
-    = lookup_minimal_symbol ("system__bb__cpu_primitives__current_fpu_context",
+    = lookup_minimal_symbol (current_program_space,
+                            "system__bb__cpu_primitives__current_fpu_context",
                             nullptr, nullptr);
   /* If the symbol can't be found, just fall back.  */
   if (fpu_context.minsym == nullptr)
index 9937b2f0a04dd7d8591c8e17f73412d4d978f1c2..ba304712bea26efa37ee289667d58f64529af15e 100644 (file)
@@ -5508,7 +5508,8 @@ 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 ());
+      bound_minimal_symbol sym
+       = lookup_minimal_symbol (current_program_space, msg.data ());
       if (sym.minsym == NULL)
        xsnprintf (msg.data (), get_remote_packet_size (), "qSymbol::%s",
                   &reply[8]);
index 25b6aa37ec0e0060331f356c4e6322897fcb46ea..db86079b3fa667429403c6f1dbf2c66e0a55bb17 100644 (file)
@@ -759,7 +759,8 @@ 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);
+  bound_minimal_symbol ms
+    = lookup_minimal_symbol (current_program_space, ld_symbol_name);
   if (!ms.minsym)
     return PS_NOSYM;
 
index 3081726a5e10b5f98f5b5aeb8df7b5307d2010f4..0beab74f49f69604af10743f4a7c0a436fadaef8 100644 (file)
@@ -63,7 +63,8 @@ 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");
+  bound_minimal_symbol msym
+    = lookup_minimal_symbol (current_program_space, "elf_bndr");
   if (msym.minsym && msym.value_address () == pc)
     return frame_unwind_caller_pc (get_current_frame ());
 
index 6ea9a1326db6afc3a6f2fa1a2fd0f34fe5aca9c8..d61100463cccc926aad8e4898879c82e06a53f2f 100644 (file)
@@ -451,7 +451,7 @@ lm_base (void)
     return info->lm_base_cache;
 
   bound_minimal_symbol got_sym
-    = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_",
+    = lookup_minimal_symbol (current_program_space, "_GLOBAL_OFFSET_TABLE_",
                             current_program_space->symfile_object_file);
 
   if (got_sym.minsym != 0)
index b10d030c965a77744d366784ae1de4ad04965a3d..c1a57683866ce8793966a5103b3e8bb2076daf68 100644 (file)
@@ -280,7 +280,7 @@ lm_base (void)
     return lm_base_cache;
 
   bound_minimal_symbol got_sym
-    = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_",
+    = lookup_minimal_symbol (current_program_space, "_GLOBAL_OFFSET_TABLE_",
                             current_program_space->symfile_object_file);
   if (got_sym.minsym == 0)
     {
@@ -842,7 +842,8 @@ main_got (void)
 {
   objfile *objf = current_program_space->symfile_object_file;
   bound_minimal_symbol got_sym
-    = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", objf);
+    = lookup_minimal_symbol (current_program_space, "_GLOBAL_OFFSET_TABLE_",
+                            objf);
   if (got_sym.minsym == 0)
     return 0;
 
index 666e173ea5d08fc3811cec7748e18cff20627de5..1a0e5424806e1f9a5b5221410e4173b10953f6cd 100644 (file)
@@ -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",
+    = lookup_minimal_symbol (current_program_space, "_r_debug",
                             current_program_space->symfile_object_file);
   if (msymbol.minsym != NULL)
     return msymbol.value_address ();
@@ -2481,7 +2481,8 @@ 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, objf);
+      bound_minimal_symbol msymbol
+       = lookup_minimal_symbol (current_program_space, *bkpt_namep, objf);
       if ((msymbol.minsym != NULL)
          && (msymbol.value_address () != 0))
        {
@@ -2501,7 +2502,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, objf);
+           = lookup_minimal_symbol (current_program_space, *bkpt_namep, objf);
          if ((msymbol.minsym != NULL)
              && (msymbol.value_address () != 0))
            {
index c9f5e9dfab1fac09196f46f4a6ffb6a016b8bbd2..49b98459a28a5caffa4661701f674da79d0d1c99 100644 (file)
@@ -3433,7 +3433,8 @@ simple_read_overlay_table (void)
   enum bfd_endian byte_order;
 
   simple_free_overlay_table ();
-  bound_minimal_symbol novlys_msym = lookup_minimal_symbol ("_novlys");
+  bound_minimal_symbol novlys_msym
+    = lookup_minimal_symbol (current_program_space, "_novlys");
   if (! novlys_msym.minsym)
     {
       error (_("Error reading inferior's overlay table: "
@@ -3442,7 +3443,8 @@ simple_read_overlay_table (void)
       return 0;
     }
 
-  bound_minimal_symbol ovly_table_msym = lookup_minimal_symbol ("_ovly_table");
+  bound_minimal_symbol ovly_table_msym
+    = lookup_minimal_symbol (current_program_space, "_ovly_table");
   if (! ovly_table_msym.minsym)
     {
       error (_("Error reading inferior's overlay table: couldn't find "
@@ -3521,7 +3523,8 @@ 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");
+       bound_minimal_symbol minsym
+         = lookup_minimal_symbol (current_program_space, "_ovly_table");
 
        if (minsym.minsym == NULL)
          error (_("Error reading inferior's overlay table: couldn't "
index 2f2366bd83a66da6a42368b4252b5535a7dd184e..a5a2e698a14d00d6663269f46c7d14b5429ebfd0 100644 (file)
@@ -2580,7 +2580,8 @@ info_scope_command (const char *args_in, int from_tty)
                case LOC_UNRESOLVED:
                  {
                    bound_minimal_symbol msym
-                     = lookup_minimal_symbol (sym->linkage_name ());
+                     = lookup_minimal_symbol (current_program_space,
+                                              sym->linkage_name ());
                    if (msym.minsym == NULL)
                      gdb_printf ("Unresolved Static");
                    else
index c37c20e90bdaa019cd972885213dc095385ea2ba..cd828537a5a4824050157c6c1a765a1539874575 100644 (file)
@@ -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 ());
+           = lookup_minimal_symbol (current_program_space, main_name ());
          if (main_symbol.minsym != nullptr)
            addr = main_symbol.value_address ();
        }
index cca610ae28d0b607f73c81ffb1f242cdf0e434cd..427fbb1ad61343bbeda9a4d5e3badd1d8a0a2c7c 100644 (file)
@@ -129,7 +129,8 @@ find_function_in_inferior (const char *name, struct objfile **objf_p)
     }
   else
     {
-      bound_minimal_symbol msymbol = lookup_minimal_symbol (name);
+      bound_minimal_symbol msymbol
+       = lookup_minimal_symbol (current_program_space, name);
 
       if (msymbol.minsym != NULL)
        {
index 42a7af4f9ff60b32f09203b8078ce94f81fed4fa..78ace05b4ba60135cf387d64136fb6dcb6a2be8c 100644 (file)
@@ -2988,7 +2988,8 @@ 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);
+         bound_minimal_symbol msym
+           = lookup_minimal_symbol (current_program_space, phys_name);
          struct type *field_type = type->field (fieldno).type ();
 
          if (!msym.minsym)
@@ -3176,7 +3177,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f,
                       nullptr).symbol;
   if (sym == nullptr)
     {
-      msym = lookup_minimal_symbol (physname);
+      msym = lookup_minimal_symbol (current_program_space, physname);
       if (msym.minsym == NULL)
        return NULL;
     }
index 6eea6346199fc5c4994af5929adb6eaed3a35ca7..c442b60623be1769e96621a11ead57fa687a3c70 100644 (file)
@@ -356,7 +356,8 @@ 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");
+      bound_minimal_symbol msymbol
+       = lookup_minimal_symbol (current_program_space, "__sdcc_enter_ix");
       if (msymbol.minsym)
        {
          value = msymbol.value_address ();
@@ -621,7 +622,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]);
+                   = lookup_minimal_symbol (current_program_space, names[i]);
                  if (!msymbol.minsym)
                    continue;
                  if (addr == msymbol.value_address ())
@@ -718,7 +719,8 @@ 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");
+      bound_minimal_symbol bh
+       = lookup_minimal_symbol (current_program_space, "_break_handler");
       if (bh.minsym)
        addr = bh.value_address ();
       else
@@ -898,7 +900,7 @@ z80_read_overlay_region_table ()
 
   z80_free_overlay_region_table ();
   bound_minimal_symbol novly_regions_msym
-    = lookup_minimal_symbol ("_novly_regions");
+    = lookup_minimal_symbol (current_program_space, "_novly_regions");
   if (! novly_regions_msym.minsym)
     {
       error (_("Error reading inferior's overlay table: "
@@ -908,7 +910,7 @@ z80_read_overlay_region_table ()
     }
 
   bound_minimal_symbol ovly_region_table_msym
-    = lookup_minimal_symbol ("_ovly_region_table");
+    = lookup_minimal_symbol (current_program_space, "_ovly_region_table");
   if (! ovly_region_table_msym.minsym)
     {
       error (_("Error reading inferior's overlay table: couldn't find "