aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-04-10 07:18:49 -0600
committerTom Tromey <tromey@adacore.com>2020-04-10 07:21:16 -0600
commit3e65b3e9aff265b8db711f742ea527b4c2e36910 (patch)
treea14ef76e2d9666c0ef18131cb99dc865158d4f52 /gdb/symtab.c
parent13302e956fb7a0c700f53f16d985c9e6207e331c (diff)
downloadgdb-3e65b3e9aff265b8db711f742ea527b4c2e36910.zip
gdb-3e65b3e9aff265b8db711f742ea527b4c2e36910.tar.gz
gdb-3e65b3e9aff265b8db711f742ea527b4c2e36910.tar.bz2
Skip separate debug files when handling copy relocations
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.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 5f07f3c..13a5a10 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -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);