From: Pedro Alves <palves@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>,
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?
Date: Sat, 06 Apr 2013 21:49:00 -0000 [thread overview]
Message-ID: <5160298B.2080903@redhat.com> (raw)
In-Reply-To: <83ip4f1knw.fsf@gnu.org>
On 03/25/2013 04:58 PM, Eli Zaretskii wrote:
>> From: Mark Kettenis <mark.kettenis@xs4all.nl>
>>> From: Eli Zaretskii <eliz@gnu.org>
>>> 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
next prev parent reply other threads:[~2013-04-06 13:56 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-20 16:09 Joel Brobecker
2013-03-20 16:14 ` Pedro Alves
2013-03-20 17:06 ` Jan Kratochvil
2013-03-20 17:08 ` Joel Sherrill
2013-03-20 17:20 ` Eli Zaretskii
2013-03-23 22:59 ` Eli Zaretskii
2013-03-24 0:01 ` Joel Brobecker
2013-03-24 0:07 ` Eli Zaretskii
2013-03-25 16:58 ` Joel Brobecker
2013-03-25 17:46 ` Eli Zaretskii
2013-03-25 18:10 ` Joel Brobecker
2013-03-29 8:02 ` Joel Brobecker
2013-03-29 14:03 ` Eli Zaretskii
2013-03-29 19:53 ` Joel Brobecker
2013-04-02 18:05 ` Eli Zaretskii
2013-04-05 13:03 ` Eli Zaretskii
2013-04-06 6:16 ` unbreak Windows hosted cross debugger builds (was: Re: one week to gdb-7.6 release?) Pedro Alves
2013-04-06 15:41 ` unbreak Windows hosted cross debugger builds " Eli Zaretskii
2013-03-29 15:23 ` one week to gdb-7.6 release? Ralf Corsepius
2013-03-29 16:42 ` m32r sim was " Joel Sherrill
2013-03-29 17:18 ` Mike Frysinger
2013-03-29 19:53 ` Joel Brobecker
2013-03-29 20:24 ` Joel Sherrill
2013-03-29 21:44 ` Joel Brobecker
2013-04-04 13:03 ` Ralf Corsepius
2013-04-10 15:01 ` Joel Brobecker
2013-03-25 19:08 ` Mark Kettenis
2013-03-25 19:12 ` Eli Zaretskii
2013-04-06 21:49 ` Pedro Alves [this message]
2013-04-07 3:58 ` Eli Zaretskii
2013-03-23 23:38 ` Joel Sherrill
2013-03-24 0:12 ` Mike Frysinger
2013-03-20 18:23 ` Ralf Corsepius
2013-04-01 19:56 ` Mike Frysinger
2013-03-29 12:53 Joel Sherrill
2013-03-29 14:15 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5160298B.2080903@redhat.com \
--to=palves@redhat.com \
--cc=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=joel.sherrill@oarcorp.com \
--cc=mark.kettenis@xs4all.nl \
--cc=ralf.corsepius@rtems.org \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox