Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5613

Re: Python enabled gdb on Windows and relocation

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <dje@google.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.04; 'folks': 0.04; 'sys': 0.04; 'e.g.,': 0.07; 'paths': 0.07; 'received:172.24': 0.07; 'variant': 0.07; 'python': 0.07; 'skip:[ 40': 0.09; 'subdirectory': 0.09; 'sun,': 0.09; 'files.': 0.10; 'scripts': 0.10; 'configure': 0.11; 'this:': 0.11; 'am,': 0.14; 'wrote:': 0.14; 'missing,': 0.16; 'route.': 0.16; 'figure': 0.18; 'repeated': 0.19; 'command': 0.19; 'discussion': 0.20; 'maybe': 0.21; 'header:In-Reply-To:1': 0.22; 'cc:addr:python-list': 0.22; 'e.g.': 0.22; 'directory.': 0.23; 'script.': 0.23; 'searches': 0.23; "skip:' 40": 0.23; 'from,': 0.25; 'windows': 0.26; 'there.': 0.26; "i'll": 0.26; 'tried': 0.27; 'van': 0.27; 'message- id:@mail.gmail.com': 0.28; 'skip:- 40': 0.29; 'subject:Windows': 0.29; '(even': 0.29; 'certainly': 0.29; "python's": 0.29; "skip:' 30": 0.29; 'probably': 0.30; 'cc:addr:python.org': 0.31; 'btw,': 0.31; 'guarantees': 0.31; 'modules,': 0.31; 'anyone': 0.31; 'import': 0.32; 'another': 0.32; 'sorry': 0.33; 'using': 0.34; 'file.': 0.34; 'there': 0.35; 'file': 0.35; 'first.': 0.35; 'print': 0.35; 'put': 0.35; 'quite': 0.36; 'doing': 0.36; 'allow': 0.36; 'enough': 0.37; 'problems': 0.37; 'skip:- 10': 0.37; 'either': 0.37; 'received:google.com': 0.38; 'goes': 0.38; 'user': 0.38; 'but': 0.38; 'pretty': 0.38; 'files': 0.38; 'current': 0.38; 'anything': 0.38; 'cc:2**1': 0.38; 'could': 0.39; 'comes': 0.39; 'where': 0.39; 'add': 0.39; 'whatever': 0.39; 'would': 0.40; 'allows': 0.40; 'messages': 0.40; 'might': 0.40; 'exact': 0.60; '2011': 0.62; 'sites': 0.62; 'free': 0.62; 'cc:no real name:2**1': 0.63; 'unique': 0.63; 'safe': 0.65; 'from:addr:google.com': 0.68; 'discovered': 0.71; 'concerns': 0.80; 'want:': 0.84; 'about,': 0.91
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1305665535; bh=HqeokLR34mxACyFdTyCMlu+vSoo=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type:Content-Transfer-Encoding; b=oljvGm4fE8OhOTILVp4f243jTqEbtu7JGxQVUoXBqwkPOcxoBgR8qDDTTqyHJJnl9 ZYyzLxgBgN5ao0dybthhg==
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=RuwbovjzcyLbnjGVsEA1s7jMECp57grGB7StTgmeFQg=; b=S2Pxml4U86kE0f8eXzs55BL60uq+XJ73ayQ4L1BAqeHYrkvfO8skUmKUE6h7+hM+Vy okkqb7w3FsJBqWwU5z+w==
DomainKey-Signature a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=oiDBEcCQNPQKDNqXYctcSCnkIZdco+qEOQzRLj8RVWg2O6e49pTlvhMjPXMFuo3fFA VzcO3cZHiS1t6OR5A/9w==
MIME-Version 1.0
In-Reply-To <BANLkTinxtGK76N9fORPZavZp1p7YiQ4icg@mail.gmail.com>
References <BANLkTikrK8DJOEpACA_uUVdZx25P5pc1tA@mail.gmail.com> <BANLkTimshMHOAnc2xtO=Vjvxg_oEZ0EUJA@mail.gmail.com> <BANLkTi=2xwRJmHfDBULRHidJUecMi0ix+w@mail.gmail.com> <BANLkTinkEF5RUwDr=29c_QBdu=abcGNNCQ@mail.gmail.com> <BANLkTinLZ+UOd3NA_zzU1o6J_odquwHtOw@mail.gmail.com> <BANLkTi=FzYyq7ZMUEC984xK=-qjQ_ZK9UA@mail.gmail.com> <BANLkTimcuE=E4zrxsjEc0u_6YCqOimaNDA@mail.gmail.com> <BANLkTinxtGK76N9fORPZavZp1p7YiQ4icg@mail.gmail.com>
Date Tue, 17 May 2011 13:52:13 -0700
Subject Re: Python enabled gdb on Windows and relocation
From Doug Evans <dje@google.com>
To vanboxem.ruben@gmail.com
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-System-Of-Record true
Cc gdb@sourceware.org, python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1714.1305665537.9059.python-list@python.org> (permalink)
Lines 51
NNTP-Posting-Host 82.94.164.166
X-Trace 1305665537 news.xs4all.nl 49044 [::ffff:82.94.164.166]:39428
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:5613

Show key headers only | View raw


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.]

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python enabled gdb on Windows and relocation Doug Evans <dje@google.com> - 2011-05-17 13:52 -0700

csiph-web