From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25638 invoked by alias); 21 Jan 2013 21:11:38 -0000 Received: (qmail 25623 invoked by uid 22791); 21 Jan 2013 21:11:37 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SARE_TOWRITE,SPF_HELO_PASS 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; Mon, 21 Jan 2013 21:11:30 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0LLBTZs026367 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 Jan 2013 16:11:29 -0500 Received: from host2.jankratochvil.net (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0LLBPgu011798 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 21 Jan 2013 16:11:28 -0500 Date: Mon, 21 Jan 2013 21:11:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [patch 4/9] TUI: Use internally fullname Message-ID: <20130121211121.GA29177@host2.jankratochvil.net> References: <20130117215935.GE16249@host2.jankratochvil.net> <87r4le1i04.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r4le1i04.fsf@fleche.redhat.com> 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-01/txt/msg00499.txt.bz2 On Mon, 21 Jan 2013 19:57:31 +0100, Tom Tromey wrote: > Jan> - && (filename_cmp (src->filename, loc->symtab->filename) == 0) > Jan> + && filename_cmp (src->fullname, > Jan> + symtab_to_fullname (loc->symtab)) == 0 > > After your patches is it ever ok to refer directly to symtab->filename? Originally I thought it almost never will so I had renamed "symtab->filename" as a private one "symtab->filename_". Only in rare cases one needed to access "filename_" - for example to fetch the file extension. symtab_to_fullname would do the whole expensive realpath business which has no effect on the file extension (+/- BASENAMES_MAY_DIFFER). But then I found these cases: @@ -203,7 +203,8 @@ iterate_over_some_symtabs (const char *name, - if (compare_filenames_for_search (s->filename, name)) + if (compare_filenames_for_search (s->filename, name) + || compare_filenames_for_search (symtab_to_fullname (s), name)) One cannot use just: + if (compare_filenames_for_search (symtab_to_fullname (s), name)) as in the case of S->FILENAME == NAME == "./gdb.base/return.c" it would be a regression because SYMTAB_TO_FULLNAME == "/gdb/testsuite/gdb.base/return.c". Formerly S->FILENAME matched NAME but SYMTAB_TO_FULLNAME does not match NAME. One could also do some "normalization" of NAME, one could strip "./" but for more complicated cases one cannot do much. The next step would be to turn various pathname comparisons rather to st_dev&&st_ino comparisons when possible which should be both faster and more universal. But that is left as another patchset; which I am not yet decided to write now. It would be a fix to this PR, which seems like a nice speedup: http://sourceware.org/bugzilla/show_bug.cgi?id=12332 Thanks, Jan