Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Add LIBDIR/gdb/python-<version> to Python search path
@ 2010-05-20 18:40 Joel Brobecker
  2010-05-20 18:40 ` [PATCH 2/2] Add gdb_libdir/python-<version> in front of " Joel Brobecker
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Joel Brobecker @ 2010-05-20 18:40 UTC (permalink / raw)
  To: gdb-patches

Hello,

I wrote the following two patches in order to allow GDB's python
interpreter to import the modules provided by the python library
from a location that's relative to GDB itself.

The intent is to allow us to package up a GDB binary with python support.
Since we do not know whether the target system on which GDB is going to
be installed has the correct version of python (or even if it has, whether
it has been built correctly), we want to also package up the python
library as well.  That way, regardless of what the target system provides,
we know the debugger will be using a well-defined version of the python
library.

The location I chose for that is GDB_LIBDIR/python-<version>, where
GDB_LIBDIR is LIBDIR/gdb by default.  So, for instance, with a prefix
set to /my/prefix/dir, a default GDB_LIDIR, and Python version 2.5,
we'd be using: /my/prefix/dir/lib/gdb/python-2.5.

So the first patch introduces --with-gdb-libdir as a new command-line
configure switch.  This allows us to change GDB_LIBDIR to something
different.

The second patch makes use of this new variable by adding the python
lib dir at the start of the python search path.  We can possibly
make it more configurable for the user by allowing him to override
the path to the python library (Eg: --with-gdb-libpythondir), but
I don't think that this is going to bring much.

Any thoughts on the approach? Obviously, this also needs documentation,
but I'd rather have the go-ahead before I start documenting the new
switch...

Thanks,
-- 
Joel


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-05-28 15:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-20 18:40 Add LIBDIR/gdb/python-<version> to Python search path Joel Brobecker
2010-05-20 18:40 ` [PATCH 2/2] Add gdb_libdir/python-<version> in front of " Joel Brobecker
2010-05-20 21:37   ` Jan Kratochvil
2010-05-20 21:49     ` Joel Brobecker
2010-05-20 22:09       ` Jan Kratochvil
2010-05-20 23:03         ` Joel Brobecker
2010-05-21  9:33   ` Doug Evans
2010-05-21 16:01     ` Joel Brobecker
2010-05-21 16:17     ` Tom Tromey
2010-05-21 19:39       ` Doug Evans
2010-05-20 18:54 ` [PATCH 1/2] Add support for --with-gdb-libdir (default: <prefix>/lib/gdb) Joel Brobecker
2010-05-27 15:04   ` Joel Brobecker
2010-05-28  5:27     ` Doug Evans
2010-05-28 16:08       ` Joel Brobecker
2010-05-20 19:03 ` Add LIBDIR/gdb/python-<version> to Python search path Daniel Jacobowitz
2010-05-20 19:15   ` Joel Brobecker
2010-05-20 19:23     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox