From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17911 invoked by alias); 12 Mar 2013 13:26:54 -0000 Received: (qmail 17889 invoked by uid 22791); 12 Mar 2013 13:26:53 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BJ X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Mar 2013 13:26:46 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2CDQjHd018381 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 12 Mar 2013 09:26:45 -0400 Received: from host2.jankratochvil.net (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2CDQfrr020613 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 12 Mar 2013 09:26:43 -0400 Date: Tue, 12 Mar 2013 13:26:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Doug Evans Subject: [patch] Accelerate filenames matching Message-ID: <20130312132640.GA21810@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-03/txt/msg00513.txt.bz2 Hi, I have read Doug's IRC line: xdje: In dw2_map_symtabs_matching_filename, in the case where compare_filenames_for_search succeeds, is there a point to falling through and trying again with the real path if dw2_map_expand_apply returns 0? So here is the fix. It could call the callback multiple times which may be considered a bug (I have not checked if it may be a problem for any of the callbacks). No regressions on {x86_64,x86_64-m32,i686}-fedora19pre-linux-gnu. Thanks, Jan gdb/ 2013-03-12 Doug Evans Jan Kratochvil * dwarf2read.c (dw2_map_symtabs_matching_filename): Put continue after any successful compare_filenames_for_search or FILENAME_CMP. * psymtab.c (partial_map_symtabs_matching_filename): Likewise. * symtab.c (iterate_over_some_symtabs): Likewise. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index faee1a8..47e4958 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -3079,6 +3079,7 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name, if (dw2_map_expand_apply (objfile, per_cu, name, real_path, callback, data)) return 1; + continue; } /* Before we invoke realpath, which can get expensive when many @@ -3093,6 +3094,7 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name, if (dw2_map_expand_apply (objfile, per_cu, name, real_path, callback, data)) return 1; + continue; } if (real_path != NULL) @@ -3105,6 +3107,7 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name, if (dw2_map_expand_apply (objfile, per_cu, name, real_path, callback, data)) return 1; + continue; } } } diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 2965e9f..7b118c5 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -183,6 +183,7 @@ partial_map_symtabs_matching_filename (struct objfile *objfile, if (partial_map_expand_apply (objfile, name, real_path, pst, callback, data)) return 1; + continue; } /* Before we invoke realpath, which can get expensive when many @@ -196,6 +197,7 @@ partial_map_symtabs_matching_filename (struct objfile *objfile, if (partial_map_expand_apply (objfile, name, real_path, pst, callback, data)) return 1; + continue; } /* If the user gave us an absolute path, try to find the file in @@ -209,6 +211,7 @@ partial_map_symtabs_matching_filename (struct objfile *objfile, if (partial_map_expand_apply (objfile, name, real_path, pst, callback, data)) return 1; + continue; } } } diff --git a/gdb/symtab.c b/gdb/symtab.c index c0e5884..c9dcf7a 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -212,6 +212,7 @@ iterate_over_some_symtabs (const char *name, { if (callback (s, data)) return 1; + continue; } /* Before we invoke realpath, which can get expensive when many @@ -224,6 +225,7 @@ iterate_over_some_symtabs (const char *name, { if (callback (s, data)) return 1; + continue; } /* If the user gave us an absolute path, try to find the file in @@ -239,6 +241,7 @@ iterate_over_some_symtabs (const char *name, { if (callback (s, data)) return 1; + continue; } } }