From 0646da15da19313ef79611081904ce5e723b0646 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 20 May 2013 20:29:44 +0000 Subject: * mi/mi-main.c: Include python-internal.h. (mi_cmd_list_features): Check gdb_python_initialized. * python/py-inferior.c (python_on_normal_stop, python_on_resume) (python_inferior_exit, python_new_objfile, add_thread_object) (delete_thread_object, py_free_inferior): Check gdb_python_initialized. * python/py-prettyprint.c (apply_val_pretty_printer): Check gdb_python_initialized. * python/py-type.c (save_objfile_types): Check gdb_python_initialized. * python/python-internal.h (gdb_python_initialized): Declare. * python/python.c (ensure_python_env): Throw exception if Python not initialized. (before_prompt_hook, source_python_script_for_objfile) (start_type_printers, apply_type_printers, free_type_printers): Check gdb_python_initialized. * varobj.c (varobj_get_display_hint) (dynamic_varobj_has_child_method, update_dynamic_varobj_children) (install_new_value_visualizer, varobj_set_visualizer) (value_get_print_value): Check gdb_python_initialized. --- gdb/mi/mi-main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gdb/mi') diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 94fda8f..9428e8c 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -52,6 +52,9 @@ #include "ctf.h" #include "ada-lang.h" #include "linespec.h" +#ifdef HAVE_PYTHON +#include "python/python-internal.h" +#endif #include #include @@ -1757,7 +1760,8 @@ mi_cmd_list_features (char *command, char **argv, int argc) ui_out_field_string (uiout, NULL, "ada-task-info"); #if HAVE_PYTHON - ui_out_field_string (uiout, NULL, "python"); + if (gdb_python_initialized) + ui_out_field_string (uiout, NULL, "python"); #endif do_cleanups (cleanup); -- cgit v1.1