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


Groups > comp.lang.python > #5339

Re: Python enabled gdb on Windows and relocation

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.134.4.91.MISMATCH!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.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.04; 'sure.': 0.05; 'think,': 0.05; 'complaining': 0.07; 'e.g.,': 0.07; 'suggesting': 0.07; 'though.': 0.07; 'working:': 0.07; 'python': 0.07; '32-bit': 0.09; 'initialized': 0.09; 'list)': 0.09; 'necessary,': 0.09; 'prefix': 0.09; 'linux': 0.11; 'am,': 0.14; 'wrote:': 0.14; '__init__': 0.16; 'expected.': 0.16; 'install.': 0.16; 'received:172.25': 0.16; '"python': 0.16; 'traceback': 0.16; '(most': 0.16; 'integrate': 0.19; 'skip:r 30': 0.19; 'temporary': 0.19; 'command': 0.19; '(or': 0.22; 'header:In-Reply-To:1': 0.22; 'cc:addr:python-list': 0.22; 'manually': 0.22; 'thu,': 0.22; 'so.': 0.22; 'trying': 0.23; '(without': 0.23; 'happen.': 0.23; 'last):': 0.23; 'wrong?': 0.23; 'version': 0.25; 'properly': 0.25; 'specify': 0.25; 'windows': 0.26; 'environment': 0.26; "i'm": 0.26; 'instead': 0.26; 'skip:b 20': 0.27; 'van': 0.27; 'message- id:@mail.gmail.com': 0.28; "doesn't": 0.28; 'changing': 0.29; 'installed': 0.29; 'error': 0.29; 'problem': 0.29; 'hi,': 0.29; 'subject:Windows': 0.29; "won't": 0.30; 'cc:addr:python.org': 0.31; 'exist.': 0.31; 'exists,': 0.31; 'it.': 0.31; 'random': 0.31; 'import': 0.32; '(including': 0.33; 'configured': 0.33; 'minor': 0.33; '\xa0\xa0\xa0': 0.33; "isn't": 0.34; 'requires': 0.35; 'there': 0.35; 'file': 0.35; 'print': 0.35; '"",': 0.35; 'missing': 0.36; 'problems': 0.37; 'some': 0.37; 'should': 0.37; 'skip:- 10': 0.37; 'run': 0.37; 'received:google.com': 0.38; 'but': 0.38; 'anything': 0.38; 'cc:2**1': 0.38; 'mailing': 0.39; 'set': 0.39; 'could': 0.39; 'how': 0.39; 'add': 0.39; 'works': 0.40; 'basic': 0.40; 'solution': 0.40; 'would': 0.40; 'happen': 0.61; '2011': 0.62; 'link': 0.62; 'cc:no real name:2**1': 0.63; 'skip:$ 10': 0.67; 'from:addr:google.com': 0.68; 'yeah.': 0.68; 'proposal': 0.68; 'below,': 0.71; '9:19': 0.84; 'received:10.190': 0.84; 'resistance': 0.84; 'time"': 0.84; 'plain-text': 0.91
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1305355143; bh=qFtT/XNswm0X0PTAuTYEvCmfwD4=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type:Content-Transfer-Encoding; b=vrCmoAoOQgZ37p8cLxZspHNVQ6TKOVUV0k8ZCus4GE/V7qAHLLdZ1Dl9jDk/v16g5 d14O6fyLQpjt6rj52qewQ==
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=Ecwkc+7+tXqV5kIDSYKVjfKhobIEE/otfgzTJyFGG5o=; b=P4A9o4n6+yPuAigJLjQtWcD8fPKjmsJiGMxaiURnUP1YvKzA2WcDcoblqn/bu4AR76 Gkl0HnA3ckQWWSdMv6Vg==
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=nBnWF1BJDy9zKcCOjTNBTsbGFAhEoiwXH9FzqTcUA8IR6KRqDvXf5kQmhKXHOg4WHd ivk7JsazsVvq5t1qNWTQ==
MIME-Version 1.0
In-Reply-To <BANLkTimshMHOAnc2xtO=Vjvxg_oEZ0EUJA@mail.gmail.com>
References <BANLkTikrK8DJOEpACA_uUVdZx25P5pc1tA@mail.gmail.com> <BANLkTimshMHOAnc2xtO=Vjvxg_oEZ0EUJA@mail.gmail.com>
Date Fri, 13 May 2011 23:38:59 -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.1539.1305355152.9059.python-list@python.org> (permalink)
Lines 67
NNTP-Posting-Host 82.94.164.166
X-Trace 1305355152 news.xs4all.nl 81479 [::ffff:82.94.164.166]:58288
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:5339

Show key headers only | View raw


On Thu, May 12, 2011 at 9:19 AM, Ruben Van Boxem
<vanboxem.ruben@gmail.com> wrote:
> (now in plain-text as required by gdb mailing list)
>
> Hi,
>
> I am currently trying to integrate Python support into my toolchain
> build (including GDB of course). It is a sysrooted
> binutils+GCC+GDB+mingw-w64 toolchain.
>
> I currently have the basic setup working: I can link gdb with my
> manually generated import lib to the python dll from the official
> Windows install. If there is anything I am missing or a very easy
> solution to the problems decsribed below, please just say so. I am
> only suggesting what I would like to happen.
>
> Now on to the problems I'd like to discuss:
>
> 1. gdb.exe won't start without me having set PYTHONPATH manually.

In a properly configured/built gdb on linux this isn't necessary, even
if python is installed in some random place.
I'm not sure about windows though.
Did you specify --with-python when you configured gdb, and if so did
you specify a value?
e.g., --with-python=SOME_VALUE

> I understand the need for this, but as gdb requires Python 2, and users
> of my toolchain may have installed Python 3 or a 32-bit version python
> they want to use from the same environment (without changing their own
> PYTHONPATH), there is no way to run python-enabled gdb.
> [...]

Yeah.
There is a proposal to add GDB_PYTHONPATH (or some such IIRC) and have
gdb use that instead of PYTHONPATH if it exists, but there's been
resistance to it.
I think(!) what would happen is that gdb would set $PYTHONPATH to the
value of $GDB_PYTHONPATH.
[Inferiors started by gdb should still get the original value of
PYTHONPATH though.]

> 2. With PYTHONPATH set as a temporary workaround, gdb starts, but
> spits out a traceback:
> Traceback (most recent call last):
>   File "<string>", line 35, in <module>
>   File "m:\development\mingw64\share\gdb/python/gdb/__init__.py", line
> 18, in <module>
>     gdb.command.pretty_printers.register_pretty_printer_commands()
>   File "m:\development\mingw64\share\gdb/python/gdb\command\pretty_printers.py",
> line 368, in register_pretty_printer_commands
>     InfoPrettyPrinter()
>   File "m:\development\mingw64\share\gdb/python/gdb\command\pretty_printers.py",
> line 100, in __init__
>     gdb.COMMAND_DATA)
> RuntimeError: Could not find command prefix info.
>
> This is a minor problem I think, as "python import time" "python print
> time.clock()" works as expected. What is wrong?

I'm not sure.
The error message is complaining that the "info" command prefix doesn't exist.
I don't see how that can happen as python is initialized long after
the info command is created.

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-13 23:38 -0700

csiph-web