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:52:00 -0000 [thread overview]
Message-ID: <BANLkTikOpwge4BZgiEeH7QHzmw542=nYPw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTinxtGK76N9fORPZavZp1p7YiQ4icg@mail.gmail.com>
On Sun, May 15, 2011 at 9:11 AM, Ruben Van Boxem
<vanboxem.ruben@gmail.com> wrote:
> I am sorry for the repeated messages that no one cares about, but I
> may have discovered GDB in its current form already allows what I
> want: I tried to figure out what exact paths the snake in gdb was
> using to search for its modules, and came up with this:
> (gdb) python import sys
> (gdb) python print sys.path
> ['m:\\development\\mingw64\\share\\gdb/python',
> 'M:\\Development\\mingw64\\bin\\python27.zip',
> 'M:\\Development\\mingw64\\bin\\DLLs',
> 'M:\\Development\\mingw64\\bin\\lib',
> 'M:\\Development\\mingw64\\bin\\lib\\plat-win',
> 'M:\\Development\\mingw64\\bin\\lib\\lib-tk',
> 'M:\\Development\\mingw64\\bin',
> 'M:\\Development\\mingw64\\bin\\lib\\site-packages']
>
> This means that every python command within gdb searches
> <sysroot>/share/gdb/python FIRST (even before an environment's
> PYTHONPATH), alleviating any concerns or problems I or anyone would
> have with another python installation, as this apparently built-in
> path comes up first. All I, or anyone interested in doing this kind of
> thing, have to do is copy all the python scripts from the Windows
> installation's Lib directory to the <sysroot>/share/gdb/python
> directory.
>
> I don't know where this path comes from, but it is quite handy, and
> makes this whole discussion moot for Python people. Only "issue" that
> I'll have to work around is the --with-python-includes and
> --with-python-libs that are missing, using either manual
> CFLAGS/LDFLAGS or a variant of your script.
IMO *if* gdb wanted to support people adding files to *its*
<sysroot>/share/gdb directory, more thought is needed - e.g. maybe
document a "site" directory for such files. Dunno. IMO we certainly
don't want to formally allow folks to willy-nilly put anything there -
no guarantees a future release might add something that collides with
something the user put there.
If and until then, you're probably pretty safe if you put everything
in a subdirectory with a unique enough name, if you really wanted to
go this route.
Btw, there is the system.gdbinit file which sites *are* free to customize.
E.g., configure --with-system-gdbinit=<sysroot>/share/gdb/system.gdbinit.
You can put whatever you want in that file.
E.g., you could add a directory to python's sys.path.
[Technically speaking, the path <sysroot>/share/gdb/system.gdbinit
goes against what I just said, but IMO this name is safe.]
next prev parent reply other threads:[~2011-05-17 20:52 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 [this message]
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='BANLkTikOpwge4BZgiEeH7QHzmw542=nYPw@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).