Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Khoo Yit Phang <khooyp@cs.umd.edu>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [RFC] Make python/lib/gdb and submodules proper Python modules
Date: Fri, 07 Sep 2012 06:19:00 -0000	[thread overview]
Message-ID: <CADPb22QniCQQMrE-Sgmo2UGwOHna=0ZgX2q+34sSnDgEFOuXVQ@mail.gmail.com> (raw)
In-Reply-To: <A0A7E3CA-2749-46AF-929D-4DF9CC17E4BA@cs.umd.edu>

Oh bother, sorry for the resend.

On Sun, Sep 2, 2012 at 8:44 PM, Khoo Yit Phang <khooyp@cs.umd.edu> wrote:
>
> Hi,
>
> I found it strange that python/lib/gdb and its submodules aren't truly
> Python modules (e.g., the python/lib/gdb/__init__.py had to explicitly refer
> to the gdb module), so I've put together a patch that makes them proper
> Python modules.
>
> This patch works by splitting out the gdb module into _gdb for the native
> code extensions (as recommended by PEP8), setting up sys.path in
> finish_python_initialization and finally loading the gdb module, as well as
> switching from using exec to reload/__import__ (which updates/creates Python
> modules). Also, I've made a few other related changes: I removed
> gdb.PYTHONDIR which isn't necessary anymore since the same information is
> available via gdb.__file__, and moved the Python code from
> finish_python_initialization to python/lib/gdb/__init__.py.
>
> One caveat about this patch is that the data-directory must contain the
> gdb module, otherwise Python will not be fully initialized (with a warning)
> and Python support will be very limited (only the _gdb module will be
> available).
>
> I've ran the testsuite on Ubuntu 11.04 with Python 2.7.1 and Python 2.4.6
> and found no regressions (you may need the patch I recently posted that adds
> -nx to a few tests to avoid spurious results).

Hi.
One thing that comes to mind is that, regardless of implementation
details, we can't easily get rid of gdb.PYTHONDIR because it's part of
the API gdb provides.
[grep PYTHONDIR doc/gdb.texinfo]


  reply	other threads:[~2012-09-07  6:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03  3:44 Khoo Yit Phang
2012-09-07  6:19 ` Doug Evans [this message]
2012-09-07 14:27   ` Khoo Yit Phang
2012-09-10 20:38 ` Tom Tromey
2012-09-12 20:00   ` Khoo Yit Phang
2012-09-13 20:56     ` Tom Tromey
2012-09-13 21:51       ` Khoo Yit Phang
2012-09-14  5:48         ` Regression for --batch [Re: [RFC] Make python/lib/gdb and submodules proper Python modules] Jan Kratochvil
2012-09-14  6:00           ` Khoo Yit Phang
2012-09-14  6:16             ` Jan Kratochvil
2012-09-14  6:26               ` Khoo Yit Phang
2012-09-14  6:37                 ` Jan Kratochvil
2012-09-14  6:53                   ` Khoo Yit Phang
2012-09-14  7:04                     ` Jan Kratochvil

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='CADPb22QniCQQMrE-Sgmo2UGwOHna=0ZgX2q+34sSnDgEFOuXVQ@mail.gmail.com' \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=khooyp@cs.umd.edu \
    /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