From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21692 invoked by alias); 6 Apr 2013 13:56:44 -0000 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 Received: (qmail 21677 invoked by uid 89); 6 Apr 2013 13:56:43 -0000 X-Spam-SWARE-Status: No, score=-8.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 06 Apr 2013 13:56:41 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r36DuVvC002688 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 6 Apr 2013 09:56:31 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r36DuRce024652; Sat, 6 Apr 2013 09:56:28 -0400 Message-ID: <5160298B.2080903@redhat.com> Date: Sat, 06 Apr 2013 21:49:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Eli Zaretskii CC: Mark Kettenis , brobecker@adacore.com, gdb-patches@sourceware.org, jan.kratochvil@redhat.com, ralf.corsepius@rtems.org, vapier@gentoo.org, joel.sherrill@oarcorp.com Subject: Re: one week to gdb-7.6 release? References: <20130320160032.GC5447@adacore.com> <83vc8myoyb.fsf@gnu.org> <83ehf64cfs.fsf@gnu.org> <20130323162534.GI5447@adacore.com> <834ng23soj.fsf@gnu.org> <20130325151825.GJ5447@adacore.com> <83k3ov1mo0.fsf@gnu.org> <201303251627.r2PGRheU015551@glazunov.sibelius.xs4all.nl> <83ip4f1knw.fsf@gnu.org> In-Reply-To: <83ip4f1knw.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-04/txt/msg00157.txt.bz2 On 03/25/2013 04:58 PM, Eli Zaretskii wrote: >> From: Mark Kettenis >>> From: Eli Zaretskii >>> I think on Posix platforms, the way to convert argv[0] to an absolute >>> file name is to search PATH. >> >> Not really; argv[0] can be set to anything. It's just convention that >> it gets set to the name of the program being executed. > > Well, if it isn't set to the name of the program, and its leading > directory doesn't name the directory where the real GDB executable > lives, then relocation of directories simply cannot work, and > shouldn't be expected to. I think we should only care about the use > cases where the pre-conditions for relocation do exist. Replying mainly for the archives. On Linux, we can always readlink /proc/self/exe to figure out the full program path. That steps out of Posix, of course. An easy way to set the argv[0] to anything is with bash's exec command: $ (exec -a foo ./gdb) ... (gdb) ^Z [1]+ Stopped ( exec -a foo ./gdb ) $ pidof foo 27543 $ readlink /proc/27543/exe /home/pedro/gdb/mygit/build/gdb/gdb I'm not suggesting this is a use case we need to bother with. -- Pedro Alves