From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18626 invoked by alias); 20 May 2010 18:40:17 -0000 Received: (qmail 18609 invoked by uid 22791); 20 May 2010 18:40:16 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 May 2010 18:40:11 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AD33D2BABF5 for ; Thu, 20 May 2010 14:40:09 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id txzgTXbFs-8n for ; Thu, 20 May 2010 14:40:09 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 6C91E2BAB88 for ; Thu, 20 May 2010 14:40:09 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 80384F58FA; Thu, 20 May 2010 11:40:07 -0700 (PDT) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Add LIBDIR/gdb/python- to Python search path Date: Thu, 20 May 2010 18:40:00 -0000 Message-Id: <1274380803-25266-1-git-send-email-brobecker@adacore.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00435.txt.bz2 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-, 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