Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Cc: Doug Evans <dje@google.com>
Subject: [patch] Accelerate filenames matching
Date: Tue, 12 Mar 2013 13:26:00 -0000	[thread overview]
Message-ID: <20130312132640.GA21810@host2.jankratochvil.net> (raw)

Hi,

I have read Doug's IRC line:
	xdje: In dw2_map_symtabs_matching_filename, in the case where compare_filenames_for_search succeeds, is there a point to falling through and trying again with the real path if dw2_map_expand_apply returns 0?

So here is the fix.  It could call the callback multiple times which may be
considered a bug (I have not checked if it may be a problem for any of the
callbacks).

No regressions on {x86_64,x86_64-m32,i686}-fedora19pre-linux-gnu.


Thanks,
Jan


gdb/
2013-03-12  Doug Evans  <dje@google.com>
	    Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf2read.c (dw2_map_symtabs_matching_filename): Put continue after
	any successful compare_filenames_for_search or FILENAME_CMP.
	* psymtab.c (partial_map_symtabs_matching_filename): Likewise.
	* symtab.c (iterate_over_some_symtabs): Likewise.

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index faee1a8..47e4958 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3079,6 +3079,7 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name,
 	      if (dw2_map_expand_apply (objfile, per_cu, name, real_path,
 					callback, data))
 		return 1;
+	      continue;
 	    }
 
 	  /* Before we invoke realpath, which can get expensive when many
@@ -3093,6 +3094,7 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name,
 	      if (dw2_map_expand_apply (objfile, per_cu, name, real_path,
 					callback, data))
 		return 1;
+	      continue;
 	    }
 
 	  if (real_path != NULL)
@@ -3105,6 +3107,7 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name,
 		  if (dw2_map_expand_apply (objfile, per_cu, name, real_path,
 					    callback, data))
 		    return 1;
+		  continue;
 		}
 	    }
 	}
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 2965e9f..7b118c5 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -183,6 +183,7 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
 	if (partial_map_expand_apply (objfile, name, real_path,
 				      pst, callback, data))
 	  return 1;
+	continue;
       }
 
     /* Before we invoke realpath, which can get expensive when many
@@ -196,6 +197,7 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
 	if (partial_map_expand_apply (objfile, name, real_path,
 				      pst, callback, data))
 	  return 1;
+	continue;
       }
 
     /* If the user gave us an absolute path, try to find the file in
@@ -209,6 +211,7 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
 	    if (partial_map_expand_apply (objfile, name, real_path,
 					  pst, callback, data))
 	      return 1;
+	    continue;
 	  }
       }
   }
diff --git a/gdb/symtab.c b/gdb/symtab.c
index c0e5884..c9dcf7a 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -212,6 +212,7 @@ iterate_over_some_symtabs (const char *name,
 	{
 	  if (callback (s, data))
 	    return 1;
+	  continue;
 	}
 
     /* Before we invoke realpath, which can get expensive when many
@@ -224,6 +225,7 @@ iterate_over_some_symtabs (const char *name,
       {
 	if (callback (s, data))
 	  return 1;
+	continue;
       }
 
     /* If the user gave us an absolute path, try to find the file in
@@ -239,6 +241,7 @@ iterate_over_some_symtabs (const char *name,
 	  {
 	    if (callback (s, data))
 	      return 1;
+	    continue;
 	  }
       }
     }


             reply	other threads:[~2013-03-12 13:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 13:26 Jan Kratochvil [this message]
2013-03-12 15:19 ` Joel Brobecker
2013-03-12 15:29   ` Jan Kratochvil
2013-03-12 17:48 ` Doug Evans
2013-03-14 16:37   ` [commit] " Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130312132640.GA21810@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox