* psymtab.c (expand_symtabs_matching_via_partial): Fix file name
authorDoug Evans <dje@google.com>
Wed, 8 May 2013 22:38:19 +0000 (22:38 +0000)
committerDoug Evans <dje@google.com>
Wed, 8 May 2013 22:38:19 +0000 (22:38 +0000)
matching test.

gdb/ChangeLog
gdb/psymtab.c

index 62cc127e92f29de929c98b973be05fa2f2b72f36..6986d0298c057133d1f79391f3f8902fb0fd2aaf 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-08  Doug Evans  <dje@google.com>
+
+       * psymtab.c (expand_symtabs_matching_via_partial): Fix file name
+       matching test.
+
 2013-05-08  Joel Brobecker  <brobecker@adacore.com>
 
        * sol-thread.c (info_cb): Factorize the code a little.
index 878bd82cc049a8d7ee08f61ad11be1795cd22911..3a1b993fa823e366dced3d4b85d03e2fc4bb9297 100644 (file)
@@ -1400,15 +1400,21 @@ expand_symtabs_matching_via_partial
 
       if (file_matcher)
        {
+         int match;
+
          if (ps->anonymous)
            continue;
 
-         /* Before we invoke realpath, which can get expensive when many
-            files are involved, do a quick comparison of the basenames.  */
-         if (!(*file_matcher) (ps->filename, data, 0)
-             && (basenames_may_differ
+         match = (*file_matcher) (ps->filename, data, 0);
+         if (!match)
+           {
+             /* Before we invoke realpath, which can get expensive when many
+                files are involved, do a quick comparison of the basenames.  */
+             if (basenames_may_differ
                  || (*file_matcher) (lbasename (ps->filename), data, 1))
-             && !(*file_matcher) (psymtab_to_fullname (ps), data, 0))
+               match = (*file_matcher) (psymtab_to_fullname (ps), data, 0);
+           }
+         if (!match)
            continue;
        }