From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15177 invoked by alias); 12 Oct 2004 14:29:13 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 15123 invoked from network); 12 Oct 2004 14:29:11 -0000 Received: from unknown (HELO main.gmane.org) (80.91.229.2) by sourceware.org with SMTP; 12 Oct 2004 14:29:11 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CHNeI-0005NF-00 for ; Tue, 12 Oct 2004 16:29:10 +0200 Received: from 66.168.89.166 ([66.168.89.166]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Oct 2004 16:29:10 +0200 Received: from gene.smith by 66.168.89.166 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Oct 2004 16:29:10 +0200 To: insight@sources.redhat.com From: geneSmith Subject: Re: Can't find source files Date: Tue, 12 Oct 2004 14:29:00 -0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 66.168.89.166 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20040910 In-Reply-To: X-SW-Source: 2004-q4/txt/msg00020.txt.bz2 Dave Korn wrote, On 10/12/2004 10:10 AM: >>-----Original Message----- >>From: insight-owner On Behalf Of geneSmith >>Sent: 12 October 2004 14:31 > > >>Dave Korn wrote, On 10/12/2004 5:04 AM: >> >> >>>>-----Original Message----- >>>>From: insight-owner On Behalf Of geneSmith >>>>Sent: 11 October 2004 23:26 > > >>>>If you set directory to: >>>> >>>>/cygdrive/d >>>> >>>>and your $cdir is /home/gene/source >>>> >>>>where d is a samba drive mapped to / >>>> >>>>Is there a reason why insight/gdb would not find the files at >>>> >>>>/cygdrive/d/home/gene/source ? > > >>> ? I can't see anything in the gdb docs that suggests it >> >>would concatenate $cdir to $cwd. Where do you get that from ? > > >>What I am implying is that gdb concatentates the paths specified by >>"directory" with the path to the source file contained in the object >>file as described in Debugging with GDB section 7.4, >>Specifying source directories. > > > That's the same bit I read. Where do you see the word 'concatenate' in > that? > > >>(Maybe I dont' completely know the meaining of $cdir?) > > > I think you're making a false assumption about how path searching works. > Look: > > " When you start GDB, its source path includes only `cdir' and `cwd', > in that order. To add other directories, use the `directory' command. " > > So, in your case, the source path will include "/home/gene/source" ($cdir, > the compilation dir) and "/cygdrive/d", your current directry ($cwd). Now > read the bit about how the path search operates: > > " GDB has a list of directories to search for > source files; this is called the "source path". Each time GDB 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. " > > So, first gdb looks for your source file in "/home/gene/source", then it > looks in "/cygdrive/d". Neither of those are the path to your source file, > so it doesn't find it. At no time does it start concatenating the different > directories in the source path. It won't look in > /cygdrive/d/home/gene/source. It won't look in /home/gene/source/cygdrive/d > either, which is what you're suggesting it should do, but is more obviously > wrong....! > > This is all just the same as how $PATH works in your shell. If you have > > PATH=/bin:/usr/bin > > you wouldn't expect it to find executables in /bin/usr/bin, would you? > > cheers, > DaveK Dave, The 9th Edition of "Debugging with GDB" on page 61 also states: "For example, suppose an executable references the file ‘/usr/src/foo-1.0/lib/foo.c’, and our source path is ‘/mnt/cross’. The file is first looked up literally; if this fails,‘/mnt/cross/usr/src/foo-1.0/lib/foo.c’ is tried; if this fails, ‘/mnt/cross/foo.c’ is opened; if this fails, an error message is printed." I think this is right after where you quoted. I have seen this work in some cases but not for the one I mention (or possibly it's still a user error). It does not explicitly say "concatentate" but that seem like what the middle example is, /mnt/cross/usr/src/foo-1.0/lib/foo.c . -gene -- Lit up like Levy's