From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4799 invoked by alias); 1 May 2004 17:12:48 -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 4785 invoked from network); 1 May 2004 17:12:46 -0000 Received: from unknown (HELO burundai.radix50.net) (82.83.204.57) by sources.redhat.com with SMTP; 1 May 2004 17:12:46 -0000 Received: from burundai.radix50.net (localhost [127.0.0.1]) by burundai.radix50.net (8.12.3/8.12.3/Debian -4) with ESMTP id i41HELLx021911 for ; Sat, 1 May 2004 19:14:21 +0200 Received: (from ibr@localhost) by burundai.radix50.net (8.12.3/8.12.3/Debian -4) id i41HEL2N021909 for gdb-patches@sources.redhat.com; Sat, 1 May 2004 19:14:21 +0200 Date: Sat, 01 May 2004 17:12:00 -0000 From: Baurjan Ismagulov To: gdb-patches@sources.redhat.com Subject: Re: handling of absolute source file paths Message-ID: <20040501171420.GB21679@ata.cs.hun.edu.tr> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20040420154855.GD9020@ata.cs.hacettepe.edu.tr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="1LKvkjL3sHcu1TtY" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-SW-Source: 2004-05/txt/msg00035.txt.bz2 --1LKvkjL3sHcu1TtY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 546 Hello, Eli! On Wed, Apr 21, 2004 at 08:51:55AM +0200, Eli Zaretskii wrote: > Note that it doesn't specify what happens if the file's name starts > with a slash or otherwise has leading directories. It would be good > to augment the manual with a more explicit description of cases such > as yours. Would you like to do that? I've tried to do that. I've removed a paragraph that seemed no longer relevant. Please review. * gdb.texinfo (Specifying source directories): Add an example for the 'directory' command. With kind regards, Baurjan. --1LKvkjL3sHcu1TtY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="src-ibr-doc_search-20040501-1848.diff" Content-length: 1971 diff -NaurpX /home/ibr/tmp/root/prg/dontdiff.ibr src.orig/gdb/doc/gdb.texinfo src-ibr/gdb/doc/gdb.texinfo --- src.orig/gdb/doc/gdb.texinfo Sun Mar 28 14:22:55 2004 +++ src-ibr/gdb/doc/gdb.texinfo Sat May 1 18:11:44 2004 @@ -4517,16 +4517,21 @@ the directories could be moved between t session. @value{GDBN} has a list of directories to search for source files; this is called the @dfn{source path}. Each time @value{GDBN} wants a source file, it tries all the directories in the list, in the order they are present -in the list, until it finds a file with the desired name. Note that -the executable search path is @emph{not} used for this purpose. Neither is -the current working directory, unless it happens to be in the source -path. +in the list, until it finds a file with the desired name. -If @value{GDBN} cannot find a source file in the source path, and the -object program records a directory, @value{GDBN} tries that directory -too. If the source path is empty, and there is no record of the -compilation directory, @value{GDBN} looks in the current directory as a -last resort. +For example, suppose an executable references the file +@samp{/usr/src/foo-1.0/lib/foo.c}, and our source path is +@samp{/mnt/cross}. The file is first looked up literally; if this +fails, @samp{/mnt/cross/usr/src/foo-1.0/lib/foo.c} is tried; if this +fails, @samp{/mnt/cross/foo.c} is opened; if this fails, an error +message is printed. The subdirectories of source path directories or +parts of the source pathname are not looked up. Plain filenames, +relative pathnames, pathnames with dots, etc. are all treated as +described above. + +Note that the executable search path is @emph{not} used to locate the +source files. Neither is the current working directory, unless it +happens to be in the source path. Whenever you reset or rearrange the source path, @value{GDBN} clears out any information it has cached about where source files are found and where --1LKvkjL3sHcu1TtY--