summaryrefslogtreecommitdiff
path: root/gdb/python/py-type.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-20 20:29:44 +0000
committerTom Tromey <tromey@redhat.com>2013-05-20 20:29:44 +0000
commit27ace36109505b3b255e60778b487decce10e92e (patch)
treef6f95bc8136dddea1723cc3e1077c36f30254b57 /gdb/python/py-type.c
parent7fb29343dacbc73483669327128c491a9a17ccaa (diff)
downloadgdb-27ace36109505b3b255e60778b487decce10e92e.tar.gz
* 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.
Diffstat (limited to 'gdb/python/py-type.c')
-rw-r--r--gdb/python/py-type.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index 05e251b023c..dd3a7518d38 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -1192,6 +1192,9 @@ save_objfile_types (struct objfile *objfile, void *datum)
htab_t copied_types;
struct cleanup *cleanup;
+ if (!gdb_python_initialized)
+ return;
+
/* This prevents another thread from freeing the objects we're
operating on. */
cleanup = ensure_python_env (get_objfile_arch (objfile), current_language);