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