binutils-gdb/gdb/python
Yit Phang Khoo b9516fa158 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.
2012-09-13 21:49:32 +00:00
..
lib/gdb Refactor Python "gdb" module into a proper Python package, by introducing 2012-09-13 21:49:32 +00:00
py-auto-load.c
py-block.c
py-bpevent.c PR python/14387: 2012-08-15 14:22:02 +00:00
py-breakpoint.c
py-cmd.c * ada-lang.c (ada_make_symbol_completion_list): Return a VEC. 2012-06-13 15:47:16 +00:00
py-continueevent.c
py-event.c PR python/14387: 2012-08-15 14:22:02 +00:00
py-event.h
py-events.h
py-evtregistry.c
py-evts.c
py-exitedevent.c PR python/14387: 2012-08-15 14:22:02 +00:00
py-finishbreakpoint.c
py-frame.c
py-function.c
py-gdb-readline.c Enable readline in Python in a GDB-specific way and block the 2012-08-22 21:04:55 +00:00
py-inferior.c * auto-load.c (_initialize_auto_load): Update. 2012-08-22 15:17:21 +00:00
py-infthread.c
py-lazy-string.c
py-newobjfileevent.c * python/py-newobjfileevent.c (create_new_objfile_event_object): 2012-09-06 20:14:13 +00:00
py-objfile.c
py-param.c
py-prettyprint.c Refactor Python "gdb" module into a proper Python package, by introducing 2012-09-13 21:49:32 +00:00
py-progspace.c * auto-load.c (_initialize_auto_load): Update. 2012-08-22 15:17:21 +00:00
py-signalevent.c PR python/14387: 2012-08-15 14:22:02 +00:00
py-stopevent.c PR python/14387: 2012-08-15 14:22:02 +00:00
py-stopevent.h
py-symbol.c
py-symtab.c 2012-06-26 Siva Chandra Reddy <sivachandra@google.com> 2012-06-27 00:21:21 +00:00
py-threadevent.c PR python/14387: 2012-08-15 14:22:02 +00:00
py-type.c gdb/ 2012-08-16 07:36:28 +00:00
py-utils.c
py-value.c
python-config.py
python-internal.h Refactor Python "gdb" module into a proper Python package, by introducing 2012-09-13 21:49:32 +00:00
python.c Refactor Python "gdb" module into a proper Python package, by introducing 2012-09-13 21:49:32 +00:00
python.h