From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19900 invoked by alias); 5 May 2005 04:15:25 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 19643 invoked from network); 5 May 2005 04:15:12 -0000 Received: from unknown (HELO legolas.inter.net.il) (192.114.186.24) by sourceware.org with SMTP; 5 May 2005 04:15:12 -0000 Received: from zaretski (IGLD-83-130-245-224.inter.net.il [83.130.245.224]) by legolas.inter.net.il (MOS 3.5.6-GR) with ESMTP id EHJ51399 (AUTH halo1); Thu, 5 May 2005 07:15:06 +0300 (IDT) Date: Thu, 05 May 2005 04:15:00 -0000 From: "Eli Zaretskii" To: gdb-patches@sources.redhat.com Message-ID: <01c55128$Blat.v2.4$d61a0ba0@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 In-reply-to: <20050504220147.GA4822@nevyn.them.org> (message from Daniel Jacobowitz on Wed, 4 May 2005 18:01:47 -0400) Subject: Re: [RFC] fullname attribute for GDB/MI stack frames Reply-to: Eli Zaretskii References: <20050503034604.GA437@nevyn.them.org> <01c55017$Blat.v2.4$3cb51f20@zahav.net.il> <20050503194856.GA4477@nevyn.them.org> <01c55021$Blat.v2.4$520aa7a0@zahav.net.il> <20050504133437.GA10578@nevyn.them.org> <20050504183127.GA19094@nevyn.them.org> <01c550eb$Blat.v2.4$24b1dce0@zahav.net.il> <20050504210717.GA2419@nevyn.them.org> <01c550f2$Blat.v2.4$07cfe520@zahav.net.il> <20050504220147.GA4822@nevyn.them.org> X-SW-Source: 2005-05/txt/msg00157.txt.bz2 > Date: Wed, 4 May 2005 18:01:47 -0400 > From: Daniel Jacobowitz > Cc: gdb-patches@sources.redhat.com > > > No, it's not. Given enough information, e.g., the leading directories > > and the basename, one can reconstruct the absolute file name even if > > it no longer exists. > > All they take as an argument is a single filename. If it doesn't > exist, how can they add any value to that? If cwd is /foo/bar and the file name passed to lrealpath is "../abc/def", I can compute the absolute name /foo/abc/def even if neither /foo/bar nor ../abc/def exist. > > In any case, the fact that realpath fails for non-existent files does > > not seem to be documented, and I, for one, would not necessarily > > expect that, as some similar functions and system calls I've met over > > the years on other platforms didn't fail like that. > > Can you give me an example? FYI, realpath in POSIX has this property, > so I don't know what you mean by "not documented". Sorry, too many similar names. I meant that lrealpath does not document that it fails for non-existent files. > > Beware: you might break things by this change, since currently > > lrealpath returns file names with backslashes, which is not a good > > idea in a program that came from the Posix world. > > GDB already handles pathnames with backslashes. So does GCC. So do > the GNU binutils. Those are the only programs I know of which use > libiberty, and except for GDB they use lrealpath already. The original > implementation of lrealpath was based on gdb_realpath, FYI. A Windows > developer did the work to make things work properly when using > GetFullPathName. I replied to this in my other message: it's IMHO unsafe to return a name with backslashes, becaues it might be passed to a program that doesn't handle them well, like Bash or Make.