From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1596 invoked by alias); 30 Mar 2010 22:14:53 -0000 Received: (qmail 1587 invoked by uid 22791); 30 Mar 2010 22:14:52 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Mar 2010 22:14:46 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2UMEcIR001638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 30 Mar 2010 18:14:38 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2UMERUn021546; Tue, 30 Mar 2010 18:14:28 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o2UMEQio012476; Tue, 30 Mar 2010 18:14:27 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 6CC9437950A; Tue, 30 Mar 2010 16:14:26 -0600 (MDT) From: Tom Tromey To: Jie Zhang Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Fix a bug in source file searching References: <4BB01CC6.3090402@codesourcery.com> Reply-To: tromey@redhat.com Date: Tue, 30 Mar 2010 22:14:00 -0000 In-Reply-To: <4BB01CC6.3090402@codesourcery.com> (Jie Zhang's message of "Mon, 29 Mar 2010 11:21:42 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg01087.txt.bz2 >>>>> "Jie" == Jie Zhang writes: Jie> I found this bug when debugging GCC. (Actually I don't know if this is Jie> a bug in GDB code or documentation.) I prepared a patch so you can Jie> easily comment. Thanks. Jie> And .gdbinit file in GCC build directory has Jie> dir ../../../svn/trunk/gcc/fortran Jie> So it looked GDB searched pathes added by dir command first. Jie> But the GDB documentation says in "9.5 Specifying Source Directories": Jie> [quote] Jie> For example, suppose an executable references the file Jie> /usr/src/foo-1.0/lib/foo.c, and our source path is /mnt/cross. The Jie> file is first looked up literally; if this fails, Jie> /mnt/cross/usr/src/foo-1.0/lib/foo.c is tried; if this fails, Jie> /mnt/cross/foo.c is opened; if this fails, an error message is Jie> printed. Jie> [/quote] Maybe the documentation is just wrong or misleading here. I say that because the special entry `$cdir' expands to the compilation directory, and you can control where this appears pretty easily. Tom