From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15927 invoked by alias); 7 Apr 2010 20:53:16 -0000 Received: (qmail 15915 invoked by uid 22791); 7 Apr 2010 20:53:14 -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; Wed, 07 Apr 2010 20:53:09 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o37Kr1sj019490 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 7 Apr 2010 16:53:01 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o37Kr1i0024262; Wed, 7 Apr 2010 16:53:01 -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 o37Kr0GX004433; Wed, 7 Apr 2010 16:53:00 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id D9EF9379851; Wed, 7 Apr 2010 14:52:59 -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> <4BB2E6F7.4020401@codesourcery.com> Reply-To: Tom Tromey Date: Wed, 07 Apr 2010 20:53:00 -0000 In-Reply-To: <4BB2E6F7.4020401@codesourcery.com> (Jie Zhang's message of "Wed, 31 Mar 2010 14:08:55 +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-04/txt/msg00161.txt.bz2 >>>>> "Jie" == Jie Zhang writes: Tom> Maybe the documentation is just wrong or misleading here. I say that Tom> because the special entry `$cdir' expands to the compilation directory, Tom> and you can control where this appears pretty easily. Jie> Maybe I misunderstood the document. I thought Jie> comp_dir = /usr/src/foo-1.0 Jie> filename = lib/foo.c Jie> should be same as Jie> comp_dir = Jie> filename = /usr/src/foo-1.0/lib/foo.c Jie> Obviously GDB treats them differently although I don't know why. FWIW, I don't really understand the rationale behind why the code works the way it does. Further down in the info node it seems clear that it is intentional that $cdir work this way, though. If DWARF intends those two cases to be the same, then perhaps the fix ought to be in dwarf2read.c. I am not sure. Jie> And I don't know why GCC adds those dir commands in its .gdbinit. I Jie> will ask on GCC mailing list. I think adding "dir $cdir" at the end of the list of dir commands would also get the behavior you want. Tom