From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5163 invoked by alias); 24 Sep 2012 16:45:44 -0000 Received: (qmail 5149 invoked by uid 22791); 24 Sep 2012 16:45:41 -0000 X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from server-nat-6.cs.umd.edu (HELO bacon.cs.umd.edu) (128.8.127.149) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Sep 2012 16:45:28 +0000 Received: from [10.109.170.227] (129-2-129-154.wireless.umd.edu [129.2.129.154]) (Authenticated sender: khooyp) by bacon.cs.umd.edu (Postfix) with ESMTPSA id D79EEB4041B; Mon, 24 Sep 2012 12:45:25 -0400 (EDT) Subject: Re: [PATCH 2/2] Try to initialize data-directory by first searching for "data-directory" in the same directory as the gdb binary Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Khoo Yit Phang In-Reply-To: <9F52A338-A158-44DC-90C1-F46503859613@cs.umd.edu> Date: Mon, 24 Sep 2012 16:45:00 -0000 Cc: Joel Brobecker , Jan Kratochvil , GDB Patches Content-Transfer-Encoding: quoted-printable Message-Id: <285502C6-1395-4049-9D55-031EDA3AD06D@cs.umd.edu> References: <20120919130040.GA20442@host2.jankratochvil.net> <20120921183122.GB8747@host2.jankratochvil.net> <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> To: Khoo Yit Phang X-CSD-MailScanner-ID: D79EEB4041B.A1A90 X-CSD-MailScanner: Found to be clean X-CSD-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-50, required 5, autolearn=not spam, ALL_TRUSTED -50.00) X-CSD-MailScanner-From: khooyp@cs.umd.edu X-CSD-MailScanner-Watermark: 1349109926.30765@MOADkKzSl9e8BAYPnvM0uw 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/msg00517.txt.bz2 Hi, On Sep 24, 2012, at 12:09 PM, Khoo Yit Phang wrote: > Hi, >=20 > On Sep 24, 2012, at 11:26 AM, Joel Brobecker wrote: >=20 >> Alternatively, we could think of having a routine that detects that >> the GDB binary is uninstalled, and relocate all the various directories >> differently. But that might be a bigger change that you'd want to, and >> I'm not sure this is something that the community might want (because >> it would add useless code for most users, only used by developers). >=20 > A simpler alternative would be to detect if the gdb_program_name =3D=3D $= 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 s= ure you don't have any embarrassing/privacy-leaking paths in your home dire= ctory 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 sy= mlink there that points to $BUILDDIR/gdb/data-directory, or make a copy for= platforms that don't support symlinks. Yit September 24, 2012