From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9436 invoked by alias); 22 Sep 2012 11:08:50 -0000 Received: (qmail 9423 invoked by uid 22791); 22 Sep 2012 11:08:49 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS 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; Sat, 22 Sep 2012 11:08:30 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8MB8Sqw023544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 22 Sep 2012 07:08:28 -0400 Received: from host2.jankratochvil.net (ovpn-113-58.phx2.redhat.com [10.3.113.58]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q8MB8NbV015814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 22 Sep 2012 07:08:27 -0400 Date: Sat, 22 Sep 2012 11:08:00 -0000 From: Jan Kratochvil To: Khoo Yit Phang Cc: GDB Patches Subject: Re: [PATCH 2/2] Try to initialize data-directory by first searching for "data-directory" in the same directory as the gdb binary Message-ID: <20120922110822.GA28159@host2.jankratochvil.net> References: <21ACC598-F6B4-4117-BA7B-B316414DE9E3@cs.umd.edu> <20120919130040.GA20442@host2.jankratochvil.net> <20120921183122.GB8747@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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: 2012-09/txt/msg00465.txt.bz2 On Fri, 21 Sep 2012 21:05:36 +0200, Khoo Yit Phang wrote: > On Sep 21, 2012, at 2:31 PM, Jan Kratochvil wrote: > > Also it could check for /usr/gdb/data-directory which is less likely to be > > present than /usr/bin/data-directory . > > That does not happen, since the first part of relocate_gdb_data_directory finds BINDIR/data-directory by finding the directory containing the gdb binary, then appending "data-directory" to it. But in your patch: > > > + build directory. */ > > + datadir = ldirname (BINDIR); > > + datadir = reconcat (datadir, datadir, > > + SLASH_STRING "gdb" SLASH_STRING "data-directory", NULL); > > + dir = relocate_path (gdb_program_name, datadir, 1, 1); > > Doesn't this have a possibility of finding /usr/gdb/data-directory? Your patch may find /usr/bin/data-directory, my patch may find /usr/gdb/data-directory, I find the latter as a less possibly existing my mistake. But maybe it does not matter much. Jan