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