public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Skip separate debug files when handling copy relocations
@ 2020-04-10 13:22 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2020-04-10 13:22 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3e65b3e9aff265b8db711f742ea527b4c2e36910

commit 3e65b3e9aff265b8db711f742ea527b4c2e36910
Author: Tom Tromey <tromey@adacore.com>
Date:   Fri Apr 10 07:18:49 2020 -0600

    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.

Diff:
---
 gdb/ChangeLog | 5 +++++
 gdb/symtab.c  | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a961511b46c..fa05f93a5e5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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):
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 5f07f3cc93e..13a5a108e6f 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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-10 13:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-10 13:22 [binutils-gdb] Skip separate debug files when handling copy relocations Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).