From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7263 invoked by alias); 21 Jan 2013 19:43:37 -0000 Received: (qmail 7253 invoked by uid 22791); 21 Jan 2013 19:43:36 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,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 19:43:30 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0LJhTj3013935 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 21 Jan 2013 14:43:29 -0500 Received: from host2.jankratochvil.net (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0LJhPFN007307 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 21 Jan 2013 14:43:28 -0500 Date: Mon, 21 Jan 2013 19:43:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: [patch 2/9] Code cleanup: Drop IS_ABSOLUTE_PATH checks Message-ID: <20130121194324.GA21692@host2.jankratochvil.net> References: <83r4li5mdj.fsf@gnu.org> <20130118193457.GA4369@host2.jankratochvil.net> <83mww65iok.fsf@gnu.org> <20130118211002.GA9261@host2.jankratochvil.net> <83d2x1r7iy.fsf@gnu.org> <20130119140914.GA7303@host2.jankratochvil.net> <834nidqjz2.fsf@gnu.org> <20130119152731.GA10298@host2.jankratochvil.net> <20130121170558.GA16410@host2.jankratochvil.net> <874nia2x3u.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874nia2x3u.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/msg00495.txt.bz2 On Mon, 21 Jan 2013 19:45:57 +0100, Tom Tromey wrote: > >>>>> "Jan" == Jan Kratochvil writes: > > Jan> Code cleanup. > Jan> * breakpoint.c (clear_command): Remove variable is_abs, unify the > Jan> call of filename_cmp with compare_filenames_for_search. > [...] > > Jan> if (full_path != NULL) > Jan> { > Jan> + gdb_assert (IS_ABSOLUTE_PATH (full_path)); > Jan> + gdb_assert (IS_ABSOLUTE_PATH (name)); > > I wonder if these can really never trigger. > > I think under some obscure conditions, xfullpath can return a relative > path, since gdb_realpath can. xfullpath is gone in a new patchset so let's talk just about gdb_realpath. May 'gdb_realpath (absolute_path)' really return a relative path? I assume it cannot although I do not see it guaranteed for example in POSIX. No other cases may happen. I have restricted when quick_symbol_functions->map_symtabs_matching_filename may be called, according to the calling cases used by the only existing caller. Thanks, Jan