From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24793 invoked by alias); 29 Sep 2003 04:58:58 -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 24786 invoked from network); 29 Sep 2003 04:58:57 -0000 Received: from unknown (HELO monty-python.gnu.org) (199.232.76.173) by sources.redhat.com with SMTP; 29 Sep 2003 04:58:57 -0000 Received: from [207.232.27.5] (helo=WST0054) by monty-python.gnu.org with asmtp (Exim 4.22) id 1A3q63-0004e9-TF; Mon, 29 Sep 2003 00:57:20 -0400 Date: Mon, 29 Sep 2003 05:18:00 -0000 Message-Id: From: Eli Zaretskii To: Bob Rossi CC: gdb@sources.redhat.com In-reply-to: <20030929024437.GD10687@white> (message from Bob Rossi on Sun, 28 Sep 2003 22:44:37 -0400) Subject: Re: Finding absolute path from relative. Reply-to: Eli Zaretskii References: <20030929022128.GB10687@white> <20030929022538.GA9969@nevyn.them.org> <20030929023111.GC10687@white> <20030929023346.GA15141@nevyn.them.org> <20030929024437.GD10687@white> X-SW-Source: 2003-09/txt/msg00363.txt.bz2 > Date: Sun, 28 Sep 2003 22:44:37 -0400 > From: Bob Rossi > > Another quick question. I have been told that some of the debug formats > support absolute paths and some do not. True. COFF is one example of debug info format that stores only the file name, without the leading directories. However, even with more advanced debug formats, such as DWARF2, the file name stored in the debug info might exclude the leading directories, depending on how the source file was specified to the compiler during compilation. E.g., try gcc -c foo.c vs gcc -c /full/path/to/foo.c and then use objdump to look at the file name recorded in foo.o's debug info. > 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? I'm not sure this problem is solvable at all, in all cases. If the leading directories are not recorded in the debug info, the assumption that the file is somewhere along the list of known source directories might not always hold, as GDB has no way of setting the list of those directories automatically.