From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16774 invoked by alias); 22 Jan 2013 06:55:14 -0000 Received: (qmail 16756 invoked by uid 22791); 22 Jan 2013 06:55:12 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Jan 2013 06:54:58 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MH000K00LUSFQ00@a-mtaout23.012.net.il> for gdb-patches@sourceware.org; Tue, 22 Jan 2013 08:54:52 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MH000KU1LVF9F60@a-mtaout23.012.net.il>; Tue, 22 Jan 2013 08:54:52 +0200 (IST) Date: Tue, 22 Jan 2013 06:55:00 -0000 From: Eli Zaretskii Subject: Re: [patch 4/9] TUI: Use internally fullname In-reply-to: <20130121211121.GA29177@host2.jankratochvil.net> To: Jan Kratochvil Cc: tromey@redhat.com, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83mww1ogfl.fsf@gnu.org> References: <20130117215935.GE16249@host2.jankratochvil.net> <87r4le1i04.fsf@fleche.redhat.com> <20130121211121.GA29177@host2.jankratochvil.net> 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/msg00504.txt.bz2 > Date: Mon, 21 Jan 2013 22:11:21 +0100 > From: Jan Kratochvil > Cc: gdb-patches@sourceware.org > > - 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. Why strip it? We could resolve "." to an absolute file name using the compilation directory, and then they will match, right? > 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. That will break on Windows, unless we replace the library implementation of 'stat' and 'fstat', or provide a method for retrieving just the inode and device number (which could be implemented on Windows using available APIs, such as GetFileInformationByHandle).