* psymtab.c (read_psymtabs_with_fullname): Don't call
authorDoug Evans <dje@google.com>
Wed, 3 Apr 2013 18:48:54 +0000 (18:48 +0000)
committerDoug Evans <dje@google.com>
Wed, 3 Apr 2013 18:48:54 +0000 (18:48 +0000)
psymtab_to_fullname if the basenames are different.

gdb/ChangeLog
gdb/psymtab.c

index 6db6cdf6a40bb8f8e92d30e541be41587014c354..ad754fc52a4d5927558927e062e1102c47a642c9 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-03  Doug Evans  <dje@google.com>
+
+       * psymtab.c (read_psymtabs_with_fullname): Don't call
+       psymtab_to_fullname if the basenames are different.
+
 2013-04-03  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * NEWS (Changes in GDB 7.6): Update the data-disassemble for "fullname".
index de8a3ccd736f5c866223a6ee4c3fb4ed4ace92d2..1d5f0ee42d90f6a42f2405d74225f2e2899b6a08 100644 (file)
@@ -1114,7 +1114,11 @@ read_psymtabs_with_fullname (struct objfile *objfile, const char *fullname)
       if (p->anonymous)
        continue;
 
-      if (filename_cmp (fullname, psymtab_to_fullname (p)) == 0)
+      /* psymtab_to_fullname tries to open the file which is slow.
+        Don't call it if we know the basenames don't match.  */
+      if ((basenames_may_differ
+          || filename_cmp (lbasename (fullname), lbasename (p->filename)) == 0)
+         && filename_cmp (fullname, psymtab_to_fullname (p)) == 0)
        psymtab_to_symtab (objfile, p);
     }
 }