Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.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: Mon, 10 Sep 2012 20:38:00 -0000	[thread overview]
Message-ID: <87obldbom1.fsf@fleche.redhat.com> (raw)
In-Reply-To: <A0A7E3CA-2749-46AF-929D-4DF9CC17E4BA@cs.umd.edu> (Khoo Yit	Phang's message of "Sun, 2 Sep 2012 23:44:10 -0400")

>>>>> "Yit" == Khoo Yit Phang <khooyp@cs.umd.edu> writes:

Yit> I found it strange that python/lib/gdb and its submodules aren't truly
Yit> Python modules (e.g., the python/lib/gdb/__init__.py had to explicitly
Yit> refer to the gdb module), so I've put together a patch that makes them
Yit> proper Python modules.

Seems reasonable to me.  Thanks.

Yit> Also, I've made a few other related
Yit> changes: I removed gdb.PYTHONDIR which isn't necessary anymore since
Yit> the same information is available via gdb.__file__, and moved the
Yit> Python code from finish_python_initialization to
Yit> python/lib/gdb/__init__.py.

I think it would be good to restore this, as Doug said.
I realize Python programs can adapt, but it is friendlier not to make
them adapt.

Yit> One caveat about this patch is that the data-directory must contain
Yit> the gdb module, otherwise Python will not be fully initialized (with a
Yit> warning) and Python support will be very limited (only the _gdb module
Yit> will be available).

I think this is probably ok.

Yit> +  if (gdb_python_module && PyObject_HasAttrString (gdb_python_module, "prompt_hook"))

This line should probably split before the "&&".

Tom


  parent reply	other threads:[~2012-09-10 20:38 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
2012-09-07 14:27   ` Khoo Yit Phang
2012-09-10 20:38 ` Tom Tromey [this message]
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=87obldbom1.fsf@fleche.redhat.com \
    --to=tromey@redhat.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