From 9dea9163560f26f9adddd13254ad32f4aea3b1d6 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Tue, 2 Nov 2010 16:48:43 +0000 Subject: * top.c: #include "python/python.h". (gdb_init): Add a comment regarding initialize_all_files. Call finish_python_initialization at the end. * python/python.h (finish_python_initialization): Declare. * python/python.c (finish_python_initialization): New function. (_initialize_python): Move python-implemented initialization there and call it. (GdbMethods): Use #ifdef HAVE_PYTHON for consistency. --- gdb/top.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gdb/top.c') diff --git a/gdb/top.c b/gdb/top.c index 8ddb2c6..6680c38 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -47,6 +47,7 @@ #include "main.h" #include "event-loop.h" #include "gdbthread.h" +#include "python/python.h" /* readline include files */ #include "readline/readline.h" @@ -1657,7 +1658,10 @@ gdb_init (char *argv0) init_cmd_lists (); /* This needs to be done first */ initialize_targets (); /* Setup target_terminal macros for utils.c */ initialize_utils (); /* Make errors and warnings possible */ + + /* Here is where we call all the _initialize_foo routines. */ initialize_all_files (); + /* This creates the current_program_space. Do this after all the _initialize_foo routines have had a chance to install their per-sspace data keys. Also do this before @@ -1684,4 +1688,12 @@ gdb_init (char *argv0) deprecated_init_ui_hook. */ if (deprecated_init_ui_hook) deprecated_init_ui_hook (argv0); + +#ifdef HAVE_PYTHON + /* Python initialization can require various commands to be installed. + For example "info pretty-printer" needs the "info" prefix to be + installed. Keep things simple and just do final python initialization + here. */ + finish_python_initialization (); +#endif } -- cgit v1.1