This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Make "backtrace" doesn't print python stack if init python dir get fail
- From: Tom Tromey <tromey at redhat dot com>
- To: Hui Zhu <hui_zhu at mentor dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Tue, 03 Dec 2013 13:26:05 -0700
- Subject: Re: [PATCH] Make "backtrace" doesn't print python stack if init python dir get fail
- Authentication-results: sourceware.org; auth=none
- References: <52974146 dot 70805 at mentor dot com> <8761r7w85h dot fsf at fleche dot redhat dot com> <529D8865 dot 80503 at mentor dot com>
>>>>> "Hui" == Hui Zhu <hui_zhu@mentor.com> writes:
Hui> I got a issue is ensure_python_env check gdb_python_initialized and
Hui> throw error if it is 0. So gdb_python_initialized to 0 will make
Hui> some commands throw error when python dir has something error. I
Hui> removed this check in the patch.
I think that's a useful consistency check, so better left in place.
Two other approaches are possible here instead. One, change
finish_python_initialization to do the needed bit of locking by handy,
not using ensure_python_env. Or, two, don't release the GIL until
somewhere in finish_python_initialization, and then it doesn't need
to call ensure_python_env at all.
Tom