From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18403 invoked by alias); 24 Sep 2012 21:08:26 -0000 Received: (qmail 18379 invoked by uid 22791); 24 Sep 2012 21:08:25 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_NIX_SPAM,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout21.012.net.il (HELO mtaout21.012.net.il) (80.179.55.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Sep 2012 21:08:05 +0000 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MAV00800H9XO800@a-mtaout21.012.net.il> for gdb-patches@sourceware.org; Mon, 24 Sep 2012 23:08:03 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAV008ZIHDFI3A0@a-mtaout21.012.net.il>; Mon, 24 Sep 2012 23:08:03 +0200 (IST) Date: Mon, 24 Sep 2012 21:08:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH 2/2] Try to initialize data-directory by first searching for "data-directory" in the same directory as the gdb binary In-reply-to: <20120924204931.GA4265@adacore.com> To: Joel Brobecker Cc: khooyp@cs.umd.edu, jan.kratochvil@redhat.com, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83d31bi0ya.fsf@gnu.org> References: <20120922110822.GA28159@host2.jankratochvil.net> <78B3333C-92F9-474D-8352-087C5A0F575B@cs.umd.edu> <20120924072945.GA4146@adacore.com> <20120924145910.GE4146@adacore.com> <2878953E-B698-43F3-989A-A551D96BAB62@cs.umd.edu> <20120924152641.GF4146@adacore.com> <9F52A338-A158-44DC-90C1-F46503859613@cs.umd.edu> <285502C6-1395-4049-9D55-031EDA3AD06D@cs.umd.edu> <83haqni93s.fsf@gnu.org> <20120924204931.GA4265@adacore.com> 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/msg00527.txt.bz2 > Date: Mon, 24 Sep 2012 22:49:31 +0200 > From: Joel Brobecker > Cc: Khoo Yit Phang , jan.kratochvil@redhat.com, > gdb-patches@sourceware.org > > > > > A simpler alternative would be to detect if the gdb_program_name > > > > == $BUILDDIR/gdb/gdb, then only look for > > > > $BUILDDIR/gdb/data-directory. It would still hard code parts of > > > > the build directory into the binary (i.e., make sure you don't > > > > have any embarrassing/privacy-leaking paths in your home directory > > > > structure), but would much lessen the risk of a stray > > > > data-directory. What do you think? > > > > > > Here's yet another alternative: gdb already tries to locate > > > data-directory in $BUILDDIR/share/gdb as part of the relocation > > > logic; we can install a symlink there that points to > > > $BUILDDIR/gdb/data-directory, or make a copy for platforms that > > > don't support symlinks. > > > > I liked the first of these two better. It is simpler. > > I am not sure it is simpler, because I don't think that the GDB binary > knows what the $BUILDDIR was. What's wrong with "../data-directory" relative to the directory from which 'gdb' was invoked?