Blame SOURCES/gdb-psymtab-expand.patch

2c2fa1
http://sourceware.org/ml/gdb-patches/2013-05/msg00300.html
2c2fa1
Subject: [RFA] Fix file name matching in expand_symtabs_matching_via_partial
2c2fa1
2c2fa1
[blech, apologies for the resend, typo in address]
2c2fa1
2c2fa1
Hi.
2c2fa1
I noticed this while playing with my new "mt expand-symtabs" command
2c2fa1
and watching "mt set per on" output.
2c2fa1
2c2fa1
The test here is wrong.
2c2fa1
ref: http://sourceware.org/ml/gdb-patches/2013-02/msg00063.html
2c2fa1
2c2fa1
The test
2c2fa1
  (basenames_may_differ
2c2fa1
   || (*file_matcher) (lbasename (ps->filename), data, 1))
2c2fa1
fails and the code falls through assuming the file name matched.
2c2fa1
2c2fa1
Regression tested on amd64-linux.
2c2fa1
2c2fa1
Ok to check in?
2c2fa1
Ok for 7.6 branch too?
2c2fa1
2c2fa1
2013-05-08  Doug Evans  <dje@google.com>
2c2fa1
2c2fa1
	* psymtab.c (expand_symtabs_matching_via_partial): Fix file name
2c2fa1
	matching test.
2c2fa1
2c2fa1
Index: psymtab.c
2c2fa1
===================================================================
2c2fa1
RCS file: /cvs/src/src/gdb/psymtab.c,v
2c2fa1
retrieving revision 1.74
2c2fa1
diff -u -p -r1.74 psymtab.c
2c2fa1
--- ./gdb/psymtab.c	6 May 2013 19:15:17 -0000	1.74
2c2fa1
+++ ./gdb/psymtab.c	8 May 2013 19:18:51 -0000
2c2fa1
@@ -1400,15 +1405,21 @@ expand_symtabs_matching_via_partial
2c2fa1
 
2c2fa1
       if (file_matcher)
2c2fa1
 	{
2c2fa1
+	  int match;
2c2fa1
+
2c2fa1
 	  if (ps->anonymous)
2c2fa1
 	    continue;
2c2fa1
 
2c2fa1
-	  /* Before we invoke realpath, which can get expensive when many
2c2fa1
-	     files are involved, do a quick comparison of the basenames.  */
2c2fa1
-	  if (!(*file_matcher) (ps->filename, data, 0)
2c2fa1
-	      && (basenames_may_differ
2c2fa1
+	  match = (*file_matcher) (ps->filename, data, 0);
2c2fa1
+	  if (! match)
2c2fa1
+	    {
2c2fa1
+	      /* Before we invoke realpath, which can get expensive when many
2c2fa1
+		 files are involved, do a quick comparison of the basenames.  */
2c2fa1
+	      if (basenames_may_differ
2c2fa1
 		  || (*file_matcher) (lbasename (ps->filename), data, 1))
2c2fa1
-	      && !(*file_matcher) (psymtab_to_fullname (ps), data, 0))
2c2fa1
+		match = (*file_matcher) (psymtab_to_fullname (ps), data, 0);
2c2fa1
+	    }
2c2fa1
+	  if (! match)
2c2fa1
 	    continue;
2c2fa1
 	}
2c2fa1
 
2c2fa1