This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
src/gdb ChangeLog python/py-prettyprint.c pyth ...
- From: khooyp at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 13 Sep 2012 21:49:33 -0000
- Subject: src/gdb ChangeLog python/py-prettyprint.c pyth ...
CVSROOT: /cvs/src
Module name: src
Changes by: khooyp@sourceware.org 2012-09-13 21:49:33
Modified files:
gdb : ChangeLog
gdb/python : py-prettyprint.c python-internal.h python.c
gdb/python/lib/gdb: __init__.py
gdb/testsuite : ChangeLog
gdb/testsuite/gdb.python: python.exp
Log message:
Refactor Python "gdb" module into a proper Python package, by introducing
a new "_gdb" module for code implemented in C, and using reload/__import__
instead of exec.
gdb/
* python/lib/gdb/__init__.py: Import * from _gdb.
(GdbOutputFile, sys.stdout, GdbOutputErrorFile, sys.stderr,
prompt_hook, sys.argv): Moved from finish_python_initialization.
(pretty_printers, PYTHONDIR): Moved from _initialize_python.
(packages, auto_load_packages): New list and function replacing
module_dict and auto-loading code, using __file__ instead of
gdb.PYTHONDIR and reload/__import__ instead of exec.
(GdbSetPythonDirectory): Replacing function of the same name
from finish_python_initialization, using reload/__import__ instead
of exec, as well as call auto_load_packages.
* python/py-prettyprint.c (find_pretty_printer_from_gdb): Check
gdb_python_module and not gdb_module.
* python/python-internal.h (gdb_python_module): Declare.
* python/python.c (gdb_python_module): New global.
(before_prompt_hook): Check gdb_python_module and not gdb_module.
(_initialize_python): Rename gdb module to _gdb.
Move gdb.PYTHONDIR and gdb.pretty_printer to lib/gdb/__init__.py.
(finish_python_initialization): Move Python code to
lib/gdb/__init__.py; instead, set up sys.path and import gdb into
__main__.
gdb/testsuite/
* gdb.python/python.exp (Test stderr location): Update module
location of GDB-specific sys.stderr.
(Test stdout location): Ditto for sys.stdout.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14654&r2=1.14655
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/py-prettyprint.c.diff?cvsroot=src&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/python-internal.h.diff?cvsroot=src&r1=1.58&r2=1.59
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/python.c.diff?cvsroot=src&r1=1.95&r2=1.96
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/lib/gdb/__init__.py.diff?cvsroot=src&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3371&r2=1.3372
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/python.exp.diff?cvsroot=src&r1=1.35&r2=1.36