summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunlian Jiang <yunlian@google.com>2017-10-18 15:07:58 -0700
committerYunlian Jiang <yunlian@google.com>2017-10-18 15:07:58 -0700
commit58f165c4164cd7680b37e3672d8b6d7053e86373 (patch)
treed6884c07935d293a51b7b9049cfebef9b7228de9
parenta0fdc06dda0f0ce61aeee2a349884b11202ff342 (diff)
downloadgdb-58f165c4164cd7680b37e3672d8b6d7053e86373.tar.gz
Fix a segmenation fault when python evironment changes.
This is a follow up CL for commit: e24220e: disable python when python is not available. BUG: None TEST: Build gdb inside ChromeOS chroot and run gdb outside it. There is no crash. Change-Id: I922c5dbac51b1e2808775f7b24edca63fc19d013
-rw-r--r--gdb-8.0.1/gdb/python/python.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb-8.0.1/gdb/python/python.c b/gdb-8.0.1/gdb/python/python.c
index 8c8755b03..6be877421 100644
--- a/gdb-8.0.1/gdb/python/python.c
+++ b/gdb-8.0.1/gdb/python/python.c
@@ -1818,7 +1818,7 @@ message == an error message without a stack will be printed."),
&user_show_python_list);
#ifdef HAVE_PYTHON
- if (!do_start_initialization () && PyErr_Occurred ())
+ if (!do_start_initialization () && python_available () && PyErr_Occurred ())
gdbpy_print_stack ();
#endif /* HAVE_PYTHON */
}