diff options
author | Yunlian Jiang <yunlian@google.com> | 2017-10-18 15:07:58 -0700 |
---|---|---|
committer | Yunlian Jiang <yunlian@google.com> | 2017-10-18 15:07:58 -0700 |
commit | 58f165c4164cd7680b37e3672d8b6d7053e86373 (patch) | |
tree | d6884c07935d293a51b7b9049cfebef9b7228de9 | |
parent | a0fdc06dda0f0ce61aeee2a349884b11202ff342 (diff) | |
download | gdb-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.c | 2 |
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 */ } |