Fix needless expansion of non-gdbindex symtabs (Doug Evans).

This commit is contained in:
Jan Kratochvil 2013-05-09 15:08:44 +02:00
parent 01f32662b6
commit 5c14ffc194
2 changed files with 70 additions and 1 deletions

62
gdb-psymtab-expand.patch Normal file
View File

@ -0,0 +1,62 @@
http://sourceware.org/ml/gdb-patches/2013-05/msg00300.html
Subject: [RFA] Fix file name matching in expand_symtabs_matching_via_partial
[blech, apologies for the resend, typo in address]
Hi.
I noticed this while playing with my new "mt expand-symtabs" command
and watching "mt set per on" output.
The test here is wrong.
ref: http://sourceware.org/ml/gdb-patches/2013-02/msg00063.html
The test
(basenames_may_differ
|| (*file_matcher) (lbasename (ps->filename), data, 1))
fails and the code falls through assuming the file name matched.
Regression tested on amd64-linux.
Ok to check in?
Ok for 7.6 branch too?
2013-05-08 Doug Evans <dje@google.com>
* psymtab.c (expand_symtabs_matching_via_partial): Fix file name
matching test.
Index: psymtab.c
===================================================================
RCS file: /cvs/src/src/gdb/psymtab.c,v
retrieving revision 1.74
diff -u -p -r1.74 psymtab.c
--- ./gdb/psymtab.c 6 May 2013 19:15:17 -0000 1.74
+++ ./gdb/psymtab.c 8 May 2013 19:18:51 -0000
@@ -1400,15 +1405,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;
}

View File

@ -36,7 +36,7 @@ Version: 7.6
# The release always contains a leading reserved number, start it at 1. # The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 27%{?dist} Release: 28%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain
Group: Development/Debuggers Group: Development/Debuggers
@ -569,6 +569,9 @@ Patch832: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
# Fix gcore for vDSO (on ppc64). # Fix gcore for vDSO (on ppc64).
Patch834: gdb-vdso-gcore.patch Patch834: gdb-vdso-gcore.patch
# Fix needless expansion of non-gdbindex symtabs (Doug Evans).
Patch835: gdb-psymtab-expand.patch
%if 0%{!?rhel:1} || 0%{?rhel} > 6 %if 0%{!?rhel:1} || 0%{?rhel} > 6
# RL_STATE_FEDORA_GDB would not be found for: # RL_STATE_FEDORA_GDB would not be found for:
# Patch642: gdb-readline62-ask-more-rh.patch # Patch642: gdb-readline62-ask-more-rh.patch
@ -891,6 +894,7 @@ find -name "*.info*"|xargs rm -f
%patch818 -p1 %patch818 -p1
%patch832 -p1 %patch832 -p1
%patch834 -p1 %patch834 -p1
%patch835 -p1
%patch393 -p1 %patch393 -p1
%if 0%{!?el5:1} || 0%{?scl:1} %if 0%{!?el5:1} || 0%{?scl:1}
@ -1394,6 +1398,9 @@ fi
%endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch" %endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch"
%changelog %changelog
* Thu May 9 2013 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.6-28.fc19
- Fix needless expansion of non-gdbindex symtabs (Doug Evans).
* Mon May 6 2013 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.6-27.fc19 * Mon May 6 2013 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.6-27.fc19
- [testsuite] [RHEL-5] Fix gdb-orphanripper.c runtime error. - [testsuite] [RHEL-5] Fix gdb-orphanripper.c runtime error.