From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32743 invoked by alias); 24 Sep 2012 15:00:45 -0000 Received: (qmail 32733 invoked by uid 22791); 24 Sep 2012 15:00:44 -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 15:00:29 +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 1CFC0B409DC; Mon, 24 Sep 2012 11:00:16 -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: <83y5jziieg.fsf@gnu.org> Date: Mon, 24 Sep 2012 15:00:00 -0000 Cc: Khoo Yit Phang , brobecker@adacore.com, jan.kratochvil@redhat.com, gdb-patches@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: <890A9038-FD1F-41BE-9FCC-0C2FFBD5F646@cs.umd.edu> References: <21ACC598-F6B4-4117-BA7B-B316414DE9E3@cs.umd.edu> <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> <836273jy7s.fsf@gnu.org> <83y5jziieg.fsf@gnu.org> To: Eli Zaretskii X-CSD-MailScanner-ID: 1CFC0B409DC.A2DC9 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: 1349103617.43025@sIImwzAqtgRXO6e8sBJn7Q 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/msg00505.txt.bz2 Hi, On Sep 24, 2012, at 10:51 AM, Eli Zaretskii wrote: >> From: Khoo Yit Phang >> Date: Mon, 24 Sep 2012 10:37:17 -0400 >> Cc: Khoo Yit Phang , >> brobecker@adacore.com, >> jan.kratochvil@redhat.com, >> gdb-patches@sourceware.org >>=20 >>> Please don't. Invoking GDB from the build directory should "just >>> work". >>=20 >> What do you mean? If we call the shell script "gdb" (only in the build-d= irectory, to clarify; it will not be installed to /usr/bin), then it will "= just work" in almost all cases, except when running gdb on gdb. >=20 > First, running gdb on gdb is an important use case. Yes, and instead of running "gdb gdb/gdb", you'd run "gdb gdb/gdb-the-real-= binary", which I think is trivial for GDB developers. > Second, there are systems (like MS-Windows) which cannot run Unix > shell scripts natively. That's easy to fix, write the redirector as a C program and compile it at t= he same time gdb-the-real-binary is compiled. > Third, why should I trust random shell scripts that come with the > distribution? Why would you trust any random binary, including gdb, that gets installed i= n the build directory? In my suggestion, the redirector will *never* be ins= talled to /usr/bin. > Forth, having a shell script that shadows a binary leads to confusion > and aggravation if the user is not aware of that dichotomy. No *user* should ever see the redirector once GDB has been installed. It's = only ever in the build directory for GDB developers to run GDB from the bui= ld directory. > There are probably more reasons why. >=20 >> If we patch the gdb binary and incur the risk that a stray data-director= y will lead to bugs. >=20 > I don't see how is this different from risk of running a stray shell > script. Again, the redirector will never be installed to /usr/bin, whereas gdb-the-= real-binary is always installed. Yit September 24, 2012