From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21890 invoked by alias); 29 Sep 2003 02:44:39 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 21883 invoked from network); 29 Sep 2003 02:44:38 -0000 Received: from unknown (HELO lakemtao02.cox.net) (68.1.17.243) by sources.redhat.com with SMTP; 29 Sep 2003 02:44:38 -0000 Received: from white ([68.9.191.65]) by lakemtao02.cox.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20030929024435.QHOP10677.lakemtao02.cox.net@white> for ; Sun, 28 Sep 2003 22:44:35 -0400 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1A3o1d-0002qN-00 for ; Sun, 28 Sep 2003 22:44:37 -0400 Date: Mon, 29 Sep 2003 04:58:00 -0000 From: Bob Rossi To: gdb@sources.redhat.com Subject: Re: Finding absolute path from relative. Message-ID: <20030929024437.GD10687@white> Mail-Followup-To: gdb@sources.redhat.com References: <20030929022128.GB10687@white> <20030929022538.GA9969@nevyn.them.org> <20030929023111.GC10687@white> <20030929023346.GA15141@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030929023346.GA15141@nevyn.them.org> User-Agent: Mutt/1.3.28i X-SW-Source: 2003-09/txt/msg00362.txt.bz2 On Sun, Sep 28, 2003 at 10:33:46PM -0400, Daniel Jacobowitz wrote: > On Sun, Sep 28, 2003 at 10:31:11PM -0400, Bob Rossi wrote: > > On Sun, Sep 28, 2003 at 10:25:38PM -0400, Daniel Jacobowitz wrote: > > > On Sun, Sep 28, 2003 at 10:21:28PM -0400, Bob Rossi wrote: > > > > Hi, > > > > > > > > I am thinking about the algorithm required to find the absolute path to > > > > a source file given the relative path and the output from 'show dir'. > > > > > > > > Is it really as easy as this, > > > > > > > > for I in 'show dir' # for each directory in show dir > > > > if $I/relative_path exists > > > > break; # Found absolute path. > > > > > > > > Or does it get more complex and obfuscated? > > > > > > Well, often the input file has a specified directory. That gets tried > > > first. > > > > > > Anyway, there's a good comment or two about this in the source code... > > > > Could you get me started in the right direction? ( ex. files of interest ) > > > > Either, I could write an MI command that would take a relative source > > path and convert it into an absolute path, or I could write a function > > in my front end that does the work. > > > > I personally think an MI command could eventually be more helpful to > > everyone. > > source.c:openp. Then, open_source_file. Thanks! Another quick question. I have been told that some of the debug formats support absolute paths and some do not. Does this just mean that some of the debug formats will give you the absolute path, and with the others, this expensive lookup is necessary? I guess the question is, in both cases, can GDB find the absolute path to a source file, given only the relative path? Bob Rossi