From: Doug Evans <dje@google.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: vanboxem.ruben@gmail.com, gdb@sourceware.org, python-list@python.org
Subject: Re: Python enabled gdb on Windows and relocation
Date: Sat, 14 May 2011 18:38:00 -0000 [thread overview]
Message-ID: <BANLkTi=Kh2CkBuFEGCBX-4ueOSkCiVuknQ@mail.gmail.com> (raw)
In-Reply-To: <83ei41fx4a.fsf@gnu.org>
On Sat, May 14, 2011 at 2:29 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Sat, 14 May 2011 11:09:13 +0200
>> From: Ruben Van Boxem <vanboxem.ruben@gmail.com>
>> Cc: gdb@sourceware.org, python-list@python.org
>>
>> 1. Check hardcoded path; my suggestion would be "<gdb executable>/../lib/python27"
>> 2. If this fails to find the necessary files/scripts, find it like you
>> described above in Linux, without PYTHONPATH set.
>> 3. Check PYTHONPATH.
>>
>> I would think only number one would change, and perhaps be only
>> enabled with a special configure option. Nothing else would have to
>> change, and Windows users would rejoice :)
>
> The problem, I think, is that it's not so easy on Unix to get the
> place where the GDB executable leaves. There isn't a system call to
> do that (similar to what Windows gives you).
>
> So I think on Posix platforms, number 2 would be used most of the
> time.
For reference sake, gdb is "relocatable".
[meaning, if you take a gdb installation and move it, it should
continue to work fine]
And if gdb's python lives inside the gdb tree, that too should
continue to work fine if moved with gdb (the value to pass to
Py_SetProgramName is appropriately (re-)computed when gdb is run).
[For completeness sake, IIRC the calculation of a path being
"relocatable" isn't bulletproof, but it works in practice.]
It's not impossible for gdb to find where it lives, but you're right
it can be moderately difficult (basically, if argv[0] isn't an
absolute path then scan $PATH for it).
next prev parent reply other threads:[~2011-05-14 18:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <BANLkTikrK8DJOEpACA_uUVdZx25P5pc1tA@mail.gmail.com>
2011-05-12 16:20 ` Ruben Van Boxem
2011-05-14 6:39 ` Doug Evans
2011-05-14 9:09 ` Ruben Van Boxem
2011-05-14 9:30 ` Eli Zaretskii
2011-05-14 10:10 ` Ruben Van Boxem
2011-05-14 18:38 ` Doug Evans [this message]
2011-05-14 18:31 ` Doug Evans
2011-05-14 18:40 ` Doug Evans
2011-05-15 12:30 ` Ruben Van Boxem
2011-05-15 13:27 ` Ruben Van Boxem
2011-05-15 16:12 ` Ruben Van Boxem
2011-05-17 16:32 ` Ruben Van Boxem
2011-05-17 20:52 ` Doug Evans
2011-06-09 2:04 ` Asm warrior
[not found] ` <BANLkTimfNgaKWbZdN-YVz9Vs2UW6vKsfiQ@mail.gmail.com>
2011-06-09 12:09 ` Ruben Van Boxem
2011-05-17 20:36 ` Doug Evans
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='BANLkTi=Kh2CkBuFEGCBX-4ueOSkCiVuknQ@mail.gmail.com' \
--to=dje@google.com \
--cc=eliz@gnu.org \
--cc=gdb@sourceware.org \
--cc=python-list@python.org \
--cc=vanboxem.ruben@gmail.com \
/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