public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: vanboxem.ruben@gmail.com
Cc: gdb@sourceware.org, python-list@python.org
Subject: Re: Python enabled gdb on Windows and relocation
Date: Tue, 17 May 2011 20:36:00 -0000	[thread overview]
Message-ID: <BANLkTin-wuBxY=CKuDijGJ8UxZew9RbQaA@mail.gmail.com> (raw)
In-Reply-To: <BANLkTimcuE=E4zrxsjEc0u_6YCqOimaNDA@mail.gmail.com>

On Sun, May 15, 2011 at 6:26 AM, Ruben Van Boxem
<vanboxem.ruben@gmail.com> wrote:
> Wow, I think I have a partial solution. Delving into the Python docs,
> for example here:
> http://docs.python.org/using/windows.html#finding-modules, you can see
> that PYTHONPATH is used first, then the Windows registry, then
> PYTHONHOME, then some default relative paths. I placed the python
> scripts all in the directory structure like so:
>
> /bin/gdb
> /bin/Lib/<python scripts>
> /bin/python27.dll
>
> This works, even without any manual PYTHONPATH intervention. Problem
> is though, that as soon as someone has a PYTHONPATH environment
> variable from a (incompatible) Python installation (think different
> bitness or version 3.x instead of 2.7.1), I cannot predict what will
> go wrong. This problem originates in Python's way of filling in the
> search path (sys.path). A true solution in the GDB case to prevent
> this collision of an incompatible PYTHONPATH would be that GDB sets an
> internal PYTHONPATH as directed by configure, uses that to load its
> Python internals, and allows the GDB child processes (apps being
> debugged) to use the environment PYTHONPATH. For now, I have a
> functional installation, but it will break as soon as someone installs
> Python on their system.

What if the user *wants* gdb's python to use $PYTHONPATH from his/her
environment?
To handle *this* case, *and* the case of an incompatible python
installation using $PYTHONPATH, there is the $GDB_PYTHONPATH proposal
(see earlier email for details).  It feels problematic to decide at
configure time whether there will or will not be an incompatible
python at runtime.

[I realize you have subsequent messages.
Just replying in sequence.]

      parent reply	other threads:[~2011-05-17 20:36 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
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 [this message]

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='BANLkTin-wuBxY=CKuDijGJ8UxZew9RbQaA@mail.gmail.com' \
    --to=dje@google.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).