Skip separate debug files when handling copy relocations
authorTom Tromey <tromey@adacore.com>
Fri, 10 Apr 2020 13:18:49 +0000 (07:18 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 10 Apr 2020 13:21:16 +0000 (07:21 -0600)
get_symbol_address and get_msymbol_address call
lookup_minimal_symbol_linkage, which iterates over the separate debug
files of the objfile that is passed in.

This means that if these functions pass in a separate debug objfile,
then they are doing unnecessary work.

This patch avoids the extra work by skipping separate debug objfiles
in the loops.

gdb/ChangeLog
2020-04-10  Tom Tromey  <tromey@adacore.com>

* symtab.c (get_symbol_address, get_msymbol_address): Skip
separate debug files.

gdb/ChangeLog
gdb/symtab.c

index a961511b46ceb79782f311809e78737bffe76352..fa05f93a5e5a46b166ab865141d06d43dee7808e 100644 (file)
@@ -1,3 +1,8 @@
+2020-04-10  Tom Tromey  <tromey@adacore.com>
+
+       * symtab.c (get_symbol_address, get_msymbol_address): Skip
+       separate debug files.
+
 2020-04-10  Hannes Domani  <ssbssa@yahoo.de>
 
        * nat/windows-nat.c (STATUS_WX86_BREAKPOINT, STATUS_WX86_SINGLE_STEP):
index 5f07f3cc93e4cc4c0bcb5d241adb5ef97e9a1a31..13a5a108e6fe9dd1f530312e4bf1feb1b71965e6 100644 (file)
@@ -6438,6 +6438,9 @@ get_symbol_address (const struct symbol *sym)
 
   for (objfile *objfile : current_program_space->objfiles ())
     {
+      if (objfile->separate_debug_objfile_backlink != nullptr)
+       continue;
+
       bound_minimal_symbol minsym
        = lookup_minimal_symbol_linkage (linkage_name, objfile);
       if (minsym.minsym != nullptr)
@@ -6458,7 +6461,8 @@ get_msymbol_address (struct objfile *objf, const struct minimal_symbol *minsym)
 
   for (objfile *objfile : current_program_space->objfiles ())
     {
-      if ((objfile->flags & OBJF_MAINLINE) != 0)
+      if (objfile->separate_debug_objfile_backlink == nullptr
+         && (objfile->flags & OBJF_MAINLINE) != 0)
        {
          bound_minimal_symbol found
            = lookup_minimal_symbol_linkage (linkage_name, objfile);
This page took 0.030697 seconds and 4 git commands to generate.